XML tag attributes being modified unexpectedly after transform

17 views
Skip to first unread message

Brian Buchalter

unread,
Sep 4, 2011, 12:37:33 PM9/4/11
to nokogiri-talk
I am using nokogiri to run a XSLT transform against a Microsoft Word
2010 document.xml file. After running the transform using Nokogiri
1.5.0 and master, I'm see one of the XML tags have been modified
unexpectedly:

Original: <w:headerReference w:type="default" r:id="rId8"/
> (line 108 of https://gist.github.com/1192173)
Transformed: <w:headerReference w:type="default" id="rId8"/>
(line 94 of https://gist.github.com/1192175)

It would seem the "r:" namespace is being removed from the attribute.
Adding back this namspace allowed Word to open the document properly.

The code executing the transform can be found at https://gist.github.com/1193123

Any guidance on why this change is happening would be helpful.

Brian Buchalter

unread,
Sep 6, 2011, 10:19:31 PM9/6/11
to nokogiri-talk
https://github.com/tenderlove/nokogiri/issues/532

On Sep 4, 10:37 am, Brian Buchalter <bal...@gmail.com> wrote:
> I am using nokogiri to run a XSLT transform against a Microsoft Word
> 2010 document.xml file.  After running the transform using Nokogiri
> 1.5.0 and master, I'm see one of the XML tags have been modified
> unexpectedly:
>
> Original:           <w:headerReference w:type="default" r:id="rId8"/>   (line 108 ofhttps://gist.github.com/1192173)
>
> Transformed:    <w:headerReference w:type="default" id="rId8"/>
> (line 94 ofhttps://gist.github.com/1192175)
>
> It would seem the "r:" namespace is being removed from the attribute.
> Adding back this namspace allowed Word to open the document properly.
>
> The code executing the transform can be found athttps://gist.github.com/1193123
Reply all
Reply to author
Forward
0 new messages