If I omit the NAMESPACES lines, then my table has the expected number of observations. If I include it, then I get zero observations:
<?xml version="1.0" encoding="windows-1252"?>
<SXLEMAP name="define_2a" version="2.1">
<NAMESPACES count="1">
<NS id="1" prefix="def">http://www.cdisc.org/ns/def/v2.0</NS>
</NAMESPACES>
<TABLE name="ItemGroupDef">
ItemGroupDef does not reference the NS id = "1". If any sees the issue or has a hint, then I would be happy to read it.
Thank you,
Kevin
The issue is that I omitted namespaces. Chevell (Parker) of SAS Tech Support, whom I thank, suggested that I debug by creating the automap. The namespaces should be:
<NAMESPACES count="3">
<NS id="1" prefix="xlink">http://www.w3.org/1999/xlink</NS>
<NS id="2" prefix="def">http://www.cdisc.org/ns/def/v2.0</NS>
<NS id="3" prefix="">http://www.cdisc.org/ns/odm/v1.3</NS>
</NAMESPACES>
Then the paths would be of this form:
<PATH syntax="XPathENR">/{3}ODM/{3}Study/{3}MetaDataVersion/{3}ItemGroupDef/{3}ItemRef/{1}WhereClauseRef</PATH>
I now have the observations:
12709 data ValueListDef ;
12710 set define.ValueListDef ;
12711 run ;
NOTE: There were 3 observations read from the data set DEFINE.ValueListDef.
NOTE: The data set WORK.VALUELISTDEF has 3 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
It should have been a clue that the resulting data sets had 0 observations, but the expected number of variables.
HTH,
Kevin
PS Note that between the OP and this post that ID for "def" changed.
What is the connection to sas ?
What is your sas code?
filename MAP
"O:\krviel\cdisc-definexml-2.0.0-1.6\referencexml\define_2a.map"
;
libname define
xmlv2
"O:\krviel\cdisc-definexml-2.0.0-1.6\define.xml"
xmlmap = MAP
;
data ItemGroupDef ;
set define.ItemGroupDef ;
run ;
filename MAP
clear
;
libname define
clear
;
I am user v9.4 on Windows, but I started in with the Unicode Support.
Thank you,
Kevin
The issue is that I omitted namespaces. Chevell (Parker) of SAS Tech Support, whom I thank, suggested that I debug by creating the automap. The namespaces should be:
<NAMESPACES count="3">
<NS id="1" prefix="xlink">http://www.w3.org/1999/xlink</NS>
<NS id="2" prefix="def">http://www.cdisc.org/ns/def/v2.0</NS>
<NS id="3" prefix="">http://www.cdisc.org/ns/odm/v1.3</NS>
</NAMESPACES>
Then the paths would be of this form:
<PATH syntax="XPathENR">/{3}ODM/{3}Study/{3}MetaDataVersion/{3}ItemGroupDef/{3}ItemRef/{1}WhereClauseRef</PATH>
I now have the observations:
12709 data ValueListDef ;
12710 set define.ValueListDef ;
12711 run ;
NOTE: There were 3 observations read from the data set DEFINE.ValueListDef.
NOTE: The data set WORK.VALUELISTDEF has 3 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
It should have been a clue that the resulting data sets had 0 observations, but the expected number of variables.
HTH,
Kevin
PS Note that between the OP and this post that ID for "def" changed.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.