W3C home > Mailing lists > Public > public-multilingualweb-lt@w3.org > November 2012

Re: XHTML Namespace problems with PHP

From: Jirka Kosek <jirka@kosek.cz>
Date: Thu, 22 Nov 2012 20:15:13 +0100
Message-ID: <50AE79C1.2060306@kosek.cz>
To: Pablo Nieto Caride <pablo.nieto@linguaserve.com>
CC: public-multilingualweb-lt@w3.org
On 22.11.2012 19:39, Pablo Nieto Caride wrote:

> I don’t know if somebody has encountered the same problem, in that case, is
> there a solution? I can’t find any apart from removing the namespaces when
> doing the xpath query. I read also that a solution might be turn the HTML
> into XHTML with the PHP Tidy extension, but I’m not sure.

I see two possibilities:

1. Convert HTML to XHTML prior loading into DOM. PHP Tidy extension
could be used for this, but it's not as robust as HTML parser
(http://about.validator.nu/htmlparser/) -- which can be invoked even fro
PHP using Java bridge

2. Modify DOM after loading HTML -- you can walk over complete DOM tree
and create new copy with namespace of elements set XHTML. This can be
done in PHP or you can implement it in XSLT.

				Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
------------------------------------------------------------------
    Bringing you XML Prague conference    http://xmlprague.cz
------------------------------------------------------------------


Received on Thursday, 22 November 2012 19:15:44 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 9 June 2013 00:25:03 UTC