Hello,
There is a lot of examples how to convert an xml file into a dataset and a dataset into an xml file.
How ever, if we are interested to )convert a dataset into an xml file using a specific xml schema definition, how can we do that using SAS?
EX: SAS Dataset .... reading the xml schema definition (xsd)....then obtaining the proper xml file
XSD (XML Schema Definition) is a World Wide Web Consortium (W3C) recommendation that specifies how to formally describe the elements in an Extensible Markup Language (XML) document. This description can be used to verify that each item of content in a document adheres to the description of the element in which the content is to be placed. XSD
Look at this simple XML document called "note.xml":
<?xml version="1.0"?>
< note>
< to>Tove</to>
< from>Jani</from>
< heading>Reminder</heading>
< body>Don't forget me this weekend!</body>
< /note>
<?xml version="1.0"?>
< xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.w3schools.com"
xmlns="https://www.w3schools.com"
elementFormDefault="qualified">
< xs:element name="note">
< xs:complexType>
< xs:sequence>
< xs:element name="to" type="xs:string"/>
< xs:element name="from" type="xs:string"/>
< xs:element name="heading" type="xs:string"/>
< xs:element name="body" type="xs:string"/>
< /xs:sequence>
< /xs:complexType>
< /xs:element>
< /xs:schema>
Regards,
Alepage
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.