XML to XSL

Discussion in 'XML' started by requeth@gmail.com, Jun 26, 2006.

  1. Guest

    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?
     
    , Jun 26, 2006
    #1
    1. Advertising

  2. wrote:
    > <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?
    >
     
    Joe Kesselman, Jun 26, 2006
    #2
    1. Advertising

  3. wrote:
    > <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.)
     
    Joe Kesselman, Jun 26, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Flood
    Replies:
    0
    Views:
    1,033
    Kevin Flood
    Sep 8, 2004
  2. Kevin Flood
    Replies:
    1
    Views:
    2,769
    Kevin Flood
    Sep 13, 2004
  3. Klaus Friese
    Replies:
    0
    Views:
    481
    Klaus Friese
    Nov 22, 2004
  4. Ray Tayek
    Replies:
    3
    Views:
    527
    Ray Tayek
    Nov 30, 2003
  5. Replies:
    1
    Views:
    3,637
    A. Bolmarcich
    May 27, 2005
Loading...

Share This Page