The result you want is not valid XML, so Nokogiri will not do that for you. The correct way that your text element should appear is this:
<text x="484" y="47.5" style="fill:black; font-family:monospace; font-size:16" text-anchor="middle" alignment-baseline="central">RES0</text>
The "style" part is meant to be one attribute, with semicolons separating the individual parts within it.
I'm not familiar with the properties `text-anchor` and `alignment-baseline`, but if they are supposed to become part of the style attribute, then you'd need to add them to that string somehow. If the result of this is not meant to be CSS-inlined in HTML (and the `<text>` tag is kind of a strong indicator that you are not building HTML here), then perhaps you are intending to pull the existing style attribute's nested values out so they can join the other attributes of your text tag.
Could you please clarify your goal here? I can offer additional suggestions once it is more clear what you expect the result to be, and whether it should be valid XML in the end. (Spoilers: Nokogiri only makes valid XML.)
Walter
> --
> You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
nokogiri-tal...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/nokogiri-talk/91bf22df-6b6f-41fe-ae10-4910d65d6c9cn%40googlegroups.com.