Re: [xslt] Transformation result DOM document does not honor xml:id
- From: Daniel Veillard <veillard redhat com>
- To: The Gnome XSLT library mailing-list <xslt gnome org>
- Subject: Re: [xslt] Transformation result DOM document does not honor xml:id
- Date: Thu, 17 Sep 2009 13:29:53 +0200
On Mon, Jun 29, 2009 at 12:04:48PM +0200, Michael Ludwig wrote:
> Daniel Veillard schrieb:
>> On Mon, Apr 06, 2009 at 04:03:09PM +0200, Michael Ludwig wrote:
>>> The result DOM document of a transformation does not honor the
>>> automatic ID-ness of an xml:id attribute.
>> Hum ... that's I think a bug in libxslt (or possibly libxml2 when
>> the attribute is added). I must admit xml:id was more though in the
>> context of a parser while here the document is generated by creating
>> the tree/DOM, still I think this should be fixed.
>> I think I found the fix, due to an optimization in libxslt which
>> broke the ID tagging of the attribute when generated. See attached
> Hi Daniel,
> thanks for looking into this. I applied your patch and repeated the
> tests; it's still not 100 % correct. The ID-ness seems to be honored
> only for attributes constructed using the <xsl:attribute> instruction,
> not for attributes appearing in literal XML. You can use the Perl and
> PHP tests I supplied to verify this.
I changed the way this is done, I think this will fix things and speed
them up too, it's in git head now.
But I wasn't able to make your tests run:
paphio:~/XSLT -> php xmlid-xsl.php xmlid-xsl.xsl
PHP Parse error: syntax error, unexpected T_STRING in
/u/veillard/XSLT/xmlid-xsl.php on line 6
paphio:~/XSLT -> perl xmlid-xsl.pl xmlid-xsl.xsl
Can't locate XML/LibXML.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl .) at xmlid-xsl.pl line 3.
BEGIN failed--compilation aborted at xmlid-xsl.pl line 3.
so I can't be 100% sure it's fixed as you expect.
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
] [Thread Prev