Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML to XSL

Reply
Thread Tools

XML to XSL

 
 
requeth@gmail.com
Guest
Posts: n/a
 
      06-26-2006
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 xmlnssl="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_HealthCareProviderInformationProviderSiteGr oup/CMS27420100_2000C/CMS27420100_2000C_TRN_ProviderTracking/CMS27420100_2000C_TRN02_ReferenceIdentification"/>
</td>
<td>
<xsl:value-of
select="CMS274/CMS274_HealthCareProviderInformationProviderSiteGr oup/CMS27420100_2000C/CMS27420300_2100CA/CMS27421400_2100CA_CRC_EFIProcessingStatusAddition al/CMS27421400_2100CA_CRC03_ConditionIndicator"/>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>


Excerpt of sample code:
<CMS274>
<CMS27410200_BHT_BeginningOfHierarchicalTransactio n
CMS27410200_BHT02_TransactionSetPurposeCode="11"
CMS27410200_BHT06_TransactionTypeCode="RK"/>
<CMS274_HealthCareProviderInformationProviderSiteG roup>
<CMS27420100_2000A>
<CMS27420300_2100AA_NM1_SubmitterName
CMS27420300_2100AA_NM109_SubmitterIdentifier="9999 99"/>
</CMS27420100_2000A>
<CMS27420100_2000C>
<CMS27420100_2000C_TRN_ProviderTracking

CMS27420100_2000C_TRN02_ReferenceIdentification="0 6132006999999"/>
<CMS27420300_2100CA>
<CMS27420300_2100CA_NM1_ProviderName
CMS27420300_2100CA_NM102_EntityTypeQualifier="1"

CMS27420300_2100CA_NM103_ProviderLastOrOrganizatio nName="Johnson"
CMS27420300_2100CA_NM104_ProviderFirstName="Tom"
CMS27420300_2100CA_NM106_ProviderNamePrefix="Mr."/>
<CMS27420500_2100CA_PER_ProviderCommunicationsCont act

CMS27420500_2100CA_PER03_CommunicationNumberQualif ier="TE"

CMS27420500_2100CA_PER04_CommunicationNumber="6106 641194"/>
<CMS27420600_2100CA_DMG_ProviderSDemographicInform ation

CMS27420600_2100CA_DMG02_ProviderBirthDate="03/13/1952"
CMS27420600_2100CA_DMG03_ProviderGenderCode="M"/>
<CMS27420700_2100CA_API_RequestStatus
CMS27420700_2100CA_API02_ActionCode="A4"/>
<CMS27421400_2100CA_CRC_EFIProcessingStatusAdditio nal
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?

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      06-26-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> <xsl:value-of
> select="CMS274/CMS274_HealthCareProviderInformationProviderSiteGr oup/CMS27420100_2000C/CMS27420100_2000C_TRN_ProviderTracking/CMS27420100_2000C_TRN02_ReferenceIdentification"/>
> </td>
> <td>
> <xsl:value-of
> select="CMS274/CMS274_HealthCareProviderInformationProviderSiteGr oup/CMS27420100_2000C/CMS27420300_2100CA/CMS27421400_2100CA_CRC_EFIProcessingStatusAddition al/CMS27421400_2100CA_CRC03_ConditionIndicator"/>
> </td>
> </tr>
> </table>
> </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
>
>
> Excerpt of sample code:
> <CMS274>
> <CMS27410200_BHT_BeginningOfHierarchicalTransactio n
> CMS27410200_BHT02_TransactionSetPurposeCode="11"
> CMS27410200_BHT06_TransactionTypeCode="RK"/>
> <CMS274_HealthCareProviderInformationProviderSiteG roup>
> <CMS27420100_2000A>
> <CMS27420300_2100AA_NM1_SubmitterName
> CMS27420300_2100AA_NM109_SubmitterIdentifier="9999 99"/>
> </CMS27420100_2000A>
> <CMS27420100_2000C>
> <CMS27420100_2000C_TRN_ProviderTracking
>
> CMS27420100_2000C_TRN02_ReferenceIdentification="0 6132006999999"/>
> <CMS27420300_2100CA>
> <CMS27420300_2100CA_NM1_ProviderName
> CMS27420300_2100CA_NM102_EntityTypeQualifier="1"
>
> CMS27420300_2100CA_NM103_ProviderLastOrOrganizatio nName="Johnson"
> CMS27420300_2100CA_NM104_ProviderFirstName="Tom"
> CMS27420300_2100CA_NM106_ProviderNamePrefix="Mr."/>
> <CMS27420500_2100CA_PER_ProviderCommunicationsCont act
>
> CMS27420500_2100CA_PER03_CommunicationNumberQualif ier="TE"
>
> CMS27420500_2100CA_PER04_CommunicationNumber="6106 641194"/>
> <CMS27420600_2100CA_DMG_ProviderSDemographicInform ation
>
> CMS27420600_2100CA_DMG02_ProviderBirthDate="03/13/1952"
> CMS27420600_2100CA_DMG03_ProviderGenderCode="M"/>
> <CMS27420700_2100CA_API_RequestStatus
> CMS27420700_2100CA_API02_ActionCode="A4"/>
> <CMS27421400_2100CA_CRC_EFIProcessingStatusAdditio nal
> 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?
>

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      06-26-2006
(E-Mail Removed) wrote:
> <xsl:value-of
> select="CMS274/CMS274_HealthCareProviderInformationProviderSiteGr oup/CMS27420100_2000C/CMS27420300_2100CA/CMS27421400_2100CA_CRC_EFIProcessingStatusAddition al/CMS27421400_2100CA_CRC03_ConditionIndicator"/>

....
> <CMS27421400_2100CA_CRC_EFIProcessingStatusAdditio nal
> 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_HealthCareProviderInformationProviderSiteGr oup/CMS27420100_2000C/CMS27420300_2100CA/CMS27421400_2100CA_CRC_EFIProcessingStatusAddition al/@CMS27421400_2100CA_CRC03_ConditionIndicator"

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL Question tp xsl:for-each and xsl:variable schaf@2wire.ch XML 1 05-27-2005 09:25 PM
tomcal/xsl - problems with xsl:include Klaus Friese Java 0 11-22-2004 10:17 AM
XSL-1000: (Fatal Error) Error while parsing XSL file (org.apache.xerces.parsers.AbstractSAXParser$AttributesProxy) Kevin Flood Java 1 09-13-2004 02:28 PM
XSL-1000: (Fatal Error) Error while parsing XSL file (org.apache.xerces.parsers.AbstractSAXParser$AttributesProxy) Kevin Flood Java 0 09-08-2004 02:11 PM
use xsl:element to output an "<xsl:template match=...> ? Ray Tayek XML 3 11-30-2003 10:14 AM



Advertisments