Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using enhanced XML Libname on SAS8.2

Status
Not open for further replies.

Exie

Programmer
Sep 3, 2003
156
AU
Hi,

I have an XML file formatted like so:

Code:
<viewentries>
   <viewentry position="1">
      <entrydata name="ID"><text>VWA04908</text></entrydata>
      <entrydata name="DESC"><text>From service request</text></entrydata>
      <entrydata name="NAME"><text>Given Surname</text></entrydata>
   </viewentry>
</viewentries>

I then made a XMLMap file like so:
Code:
<SXLEMAP version="1.0"> <!--  version="1.1" -->
  <TABLE name="Assignments">
    <TABLE_XPATH>/viewentries/viewentry</TABLE_XPATH>
    <COLUMN name="ID">
      <XPATH>/viewentries/viewentry@position</XPATH>
      <TYPE>character</TYPE>
      <DATATYPE>string</DATATYPE>
      <LENGTH>100</LENGTH>
    </COLUMN>
    <COLUMN name="AssignmentID">
      <XPATH>>/viewentries/viewentry/entrydata[@name="ID"] </XPATH>
      <TYPE>character</TYPE>
      <DATATYPE>string</DATATYPE>
      <LENGTH>100</LENGTH>
    </COLUMN>
  </TABLE>
</SXLEMAP>

This imports first column (position attribute) cool, but it wont pull in the second colunm (ID). I've been stuffing around with this for days, and I cant get the XPATH value to retrieve anything.

Any thoughts/tips ?

 
Have you figured out why this code doesn't work the way wanted it to?
Klaz
 
Yup,
I emailed the SAS R&D team, who have now released a hotfix for SAS8.2 upgrading it to full production XML Libname support. With this installed, you can use SXLE 1.1 which is used in SAS9.

After installing this, I found the "name" form of XPATH queries worked ok, however I still cant access the text elements under each node (with the name query).

The dude from SAS said he played with the file, and wasnt able to do this either. Unfortunately, thats just how the data come out of Lotus Notes :(

I havent had much time to play around with this after that, but keen if anyone else has any ideas ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top