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

Re: XHTML Namespace problems with PHP

From: Karl Fritsche <karl.fritsche@cocomore.com>
Date: Fri, 23 Nov 2012 09:52:38 +0100
Message-ID: <50AF3956.20609@cocomore.com>
To: <public-multilingualweb-lt@w3.org>
Hi Pablo, all,

I tried Tidy on my side, but got into the Problem, that Tidy removes the 
<its:rules>-Tag completely. Even if I registered the its Namespace, so 
be careful with the Tidy package.
On the other side as you have the a valid HTML there are no <its:rules> 
inside it, so you could use it. I only wanted to make sure that I have a 
valid XHTML before sending it, thats why I tried to use Tidy.

Cheers,
Karl

On 22.11.2012 20:15, Jirka Kosek wrote:
> 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
>
Received on Friday, 23 November 2012 08:53:24 UTC

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