BookmarkSubscribeRSS Feed
alepage
Barite | Level 11

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

1 REPLY 1

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 904 views
  • 0 likes
  • 2 in conversation