Re: [xslt] Transformation result DOM document does not honor xml:id



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
>> patch
>
> 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/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi
/usr/local/lib/perl5/site_perl/5.10.0
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl
/usr/lib64/perl5/5.10.0/x86_64-linux-thread-multi /usr/lib/perl5/5.10.0
/usr/lib/perl5/site_perl .) at xmlid-xsl.pl line 3.
BEGIN failed--compilation aborted at xmlid-xsl.pl line 3.
paphio:~/XSLT ->

  so I can't be 100% sure it's fixed as you expect.

Daniel

-- 
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/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]