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

RE: XHTML Namespace problems with PHP

From: Pablo Nieto Caride <pablo.nieto@linguaserve.com>
Date: Fri, 23 Nov 2012 09:47:26 +0100
To: "'Jirka Kosek'" <jirka@kosek.cz>
Cc: <public-multilingualweb-lt@w3.org>
Message-ID: <14e101cdc957$29963520$7cc29f60$@linguaserve.com>
Thanks a lot Jirka, I'll look into them.

Cheers,
Pablo.


> 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 Friday, 23 November 2012 08:47:57 UTC

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