XML to XSL

R

requeth

Hey, I have a slightly different XML file type then I'm used to and my
XSL will not parse the data in at all. Could someone look at it for me
and see if I'm just an idiot?

XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">

<html>
<body>
<h2>Summary Report</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Tracking ID</th>
<th align="left">Condition Indicator</th>
</tr>
<tr>
<td>
<xsl:value-of
select="CMS274/CMS274_HealthCareProviderInformationProviderSiteGroup/CMS27420100_2000C/CMS27420100_2000C_TRN_ProviderTracking/CMS27420100_2000C_TRN02_ReferenceIdentification"/>
</td>
<td>
<xsl:value-of
select="CMS274/CMS274_HealthCareProviderInformationProviderSiteGroup/CMS27420100_2000C/CMS27420300_2100CA/CMS27421400_2100CA_CRC_EFIProcessingStatusAdditional/CMS27421400_2100CA_CRC03_ConditionIndicator"/>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>


Excerpt of sample code:
<CMS274>
<CMS27410200_BHT_BeginningOfHierarchicalTransaction
CMS27410200_BHT02_TransactionSetPurposeCode="11"
CMS27410200_BHT06_TransactionTypeCode="RK"/>
<CMS274_HealthCareProviderInformationProviderSiteGroup>
<CMS27420100_2000A>
<CMS27420300_2100AA_NM1_SubmitterName
CMS27420300_2100AA_NM109_SubmitterIdentifier="999999"/>
</CMS27420100_2000A>
<CMS27420100_2000C>
<CMS27420100_2000C_TRN_ProviderTracking

CMS27420100_2000C_TRN02_ReferenceIdentification="06132006999999"/>
<CMS27420300_2100CA>
<CMS27420300_2100CA_NM1_ProviderName
CMS27420300_2100CA_NM102_EntityTypeQualifier="1"

CMS27420300_2100CA_NM103_ProviderLastOrOrganizationName="Johnson"
CMS27420300_2100CA_NM104_ProviderFirstName="Tom"
CMS27420300_2100CA_NM106_ProviderNamePrefix="Mr."/>
<CMS27420500_2100CA_PER_ProviderCommunicationsContact

CMS27420500_2100CA_PER03_CommunicationNumberQualifier="TE"

CMS27420500_2100CA_PER04_CommunicationNumber="6106641194"/>
<CMS27420600_2100CA_DMG_ProviderSDemographicInformation

CMS27420600_2100CA_DMG02_ProviderBirthDate="03/13/1952"
CMS27420600_2100CA_DMG03_ProviderGenderCode="M"/>
<CMS27420700_2100CA_API_RequestStatus
CMS27420700_2100CA_API02_ActionCode="A4"/>
<CMS27421400_2100CA_CRC_EFIProcessingStatusAdditional
CMS27421400_2100CA_CRC03_ConditionIndicator="12"
CMS27421400_2100CA_CRC05_ConditionDetail="Gate
Keeper routines have flagged the record for Enumerator review"/>
....

My program Oxygen tries to relate the path to the lowest element, but
not the attribute. I normally have the data between
<person>Myname</person> style tags, I do not know how to pull the data
in this form. I have tried parsing in IE6 and Oxygen7Any ideas?
 
J

Joe Kesselman

<xsl:value-of
select="CMS274/CMS274_HealthCareProviderInformationProviderSiteGroup/CMS27420100_2000C/CMS27420100_2000C_TRN_ProviderTracking/CMS27420100_2000C_TRN02_ReferenceIdentification"/>
</td>
<td>
<xsl:value-of
select="CMS274/CMS274_HealthCareProviderInformationProviderSiteGroup/CMS27420100_2000C/CMS27420300_2100CA/CMS27421400_2100CA_CRC_EFIProcessingStatusAdditional/CMS27421400_2100CA_CRC03_ConditionIndicator"/>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>


Excerpt of sample code:
<CMS274>
<CMS27410200_BHT_BeginningOfHierarchicalTransaction
CMS27410200_BHT02_TransactionSetPurposeCode="11"
CMS27410200_BHT06_TransactionTypeCode="RK"/>
<CMS274_HealthCareProviderInformationProviderSiteGroup>
<CMS27420100_2000A>
<CMS27420300_2100AA_NM1_SubmitterName
CMS27420300_2100AA_NM109_SubmitterIdentifier="999999"/>
</CMS27420100_2000A>
<CMS27420100_2000C>
<CMS27420100_2000C_TRN_ProviderTracking

CMS27420100_2000C_TRN02_ReferenceIdentification="06132006999999"/>
<CMS27420300_2100CA>
<CMS27420300_2100CA_NM1_ProviderName
CMS27420300_2100CA_NM102_EntityTypeQualifier="1"

CMS27420300_2100CA_NM103_ProviderLastOrOrganizationName="Johnson"
CMS27420300_2100CA_NM104_ProviderFirstName="Tom"
CMS27420300_2100CA_NM106_ProviderNamePrefix="Mr."/>
<CMS27420500_2100CA_PER_ProviderCommunicationsContact

CMS27420500_2100CA_PER03_CommunicationNumberQualifier="TE"

CMS27420500_2100CA_PER04_CommunicationNumber="6106641194"/>
<CMS27420600_2100CA_DMG_ProviderSDemographicInformation

CMS27420600_2100CA_DMG02_ProviderBirthDate="03/13/1952"
CMS27420600_2100CA_DMG03_ProviderGenderCode="M"/>
<CMS27420700_2100CA_API_RequestStatus
CMS27420700_2100CA_API02_ActionCode="A4"/>
<CMS27421400_2100CA_CRC_EFIProcessingStatusAdditional
CMS27421400_2100CA_CRC03_ConditionIndicator="12"
CMS27421400_2100CA_CRC05_ConditionDetail="Gate
Keeper routines have flagged the record for Enumerator review"/>
...

My program Oxygen tries to relate the path to the lowest element, but
not the attribute. I normally have the data between
<person>Myname</person> style tags, I do not know how to pull the data
in this form. I have tried parsing in IE6 and Oxygen7Any ideas?
 
J

Joe Kesselman

<xsl:value-of
select="CMS274/CMS274_HealthCareProviderInformationProviderSiteGroup/CMS27420100_2000C/CMS27420300_2100CA/CMS27421400_2100CA_CRC_EFIProcessingStatusAdditional/CMS27421400_2100CA_CRC03_ConditionIndicator"/> ....
<CMS27421400_2100CA_CRC_EFIProcessingStatusAdditional
CMS27421400_2100CA_CRC03_ConditionIndicator="12"
CMS27421400_2100CA_CRC05_ConditionDetail="Gate
Keeper routines have flagged the record for Enumerator review"/>

You need to use @ (or attribute::) to refer to an attribute. Change the
path to:

"CMS274/CMS274_HealthCareProviderInformationProviderSiteGroup/CMS27420100_2000C/CMS27420300_2100CA/CMS27421400_2100CA_CRC_EFIProcessingStatusAdditional/@CMS27421400_2100CA_CRC03_ConditionIndicator"

(Since this is basic XPath usage, it suggests that you might want to
review a good XPath tutorial.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top