Transform an XML Document’s Attributes into Elements


If you have an XML document that uses attributes only, you can easily transform that document into a document that uses elements instead.

With XSLT you can transform an XML document into HTML. XSLT (eXtensible Stylesheet Language Transformations) is the recommended style sheet language for XML.

There is a website you can go to to accomplish this. It is courtesy of O’Reilly. We will use shell tools online’s XSLT PROCESSOR to transform the attributes-only XML we just generated. Paste the above XSLT code into the input ‘xslt’ text box and the attribute-only XML output of the previous SQL script into the input ‘xml’ text box, then click the ‘Submit Query’ button.