Menu

0.92beta. me or it?

Help
2004-12-06
2013-04-17
  • David Wynter

    David Wynter - 2004-12-06

    Hi,

    New to Treebeard and XSLT. I have the following apprently legal XSLT (no errors). But it does not produce any output, not sure if it is me or it.

    <?xml version="1.0" encoding="iso-8859-1"?>
    <CorporateActionAnnouncement xmlns="http://tempuri.org/test.xsd">
        <AnnouncementDetails>
            <Released>2004-09-27</Released>
        </AnnouncementDetails>
        <Announcement>
            <Title>test</Title>
        </Announcement>
        <CorporateAction>
            <GeneralInformationBlock>
                <FunctionofMessage>2</FunctionofMessage>
            </GeneralInformationBlock>
            <UnderlyingSecurities>
                <UnderlyingSecurityISIN>
                    <Listing>PLIS</Listing>
                </UnderlyingSecurityISIN>
            </UnderlyingSecurities>
            <CorporateActionDetail>
                <RecordDate>2004-08-20</RecordDate>
            </CorporateActionDetail>
            <CorporateActionOption>
                <CorporateActionOptionNumber>001</CorporateActionOptionNumber>
                <CashPaymentDetails>
                    <PaymentDate>2004-10-06</PaymentDate>
                </CashPaymentDetails>
                <SecuritiesMovement>
                    <DebitCreditIndicator></DebitCreditIndicator>
                </SecuritiesMovement>
            </CorporateActionOption>
            <CorporateActionOption>
                <CorporateActionOptionNumber>002</CorporateActionOptionNumber>
                <CorporateActionOptionsCode>Securities Option</CorporateActionOptionsCode>
                <DefaultProcessingFlag>2</DefaultProcessingFlag>
                <CashPaymentDetails>
                    <PaymentDate></PaymentDate>
                </CashPaymentDetails>
                <SecuritiesMovement>
                    <DebitCreditIndicator>Credit</DebitCreditIndicator>
                </SecuritiesMovement>
            </CorporateActionOption>
        </CorporateAction>
    </CorporateActionAnnouncement>

    xslt here----------------------------------------->

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output method="text" indent="no" encoding="ISO-8859-1"/>
        <xsl:template match="/">
    <xsl:apply-templates select="/CorporateActionAnnouncement/CorporateAction/GeneralInformationBlock"></xsl:apply-templates>
    <xsl:apply-templates select="/CorporateActionAnnouncement/CorporateAction/UnderlyingSecurities"></xsl:apply-templates>
    <xsl:apply-templates select="/CorporateActionAnnouncement/CorporateAction/CorporateActionDetail"></xsl:apply-templates>
    <xsl:apply-templates select="/CorporateActionAnnouncement/CorporateAction/CorporateActionOption"></xsl:apply-templates>
        </xsl:template>

        <xsl:template match="GeneralInformationBlock">
    testoutput<xsl:call-template name="funcmsglookup"><xsl:with-param name="codef" select="FunctionofMessage"/></xsl:call-template>
    moretestoutput
        </xsl:template>

        <xsl:template match="UnderlyingSecurities">
    /<xsl:value-of select="UnderlyingSecurityISIN/Listing"/>/
        </xsl:template>

        <xsl:template match="CorporateActionDetail">
    test//<xsl:call-template name="dateformat"><xsl:with-param name="adate" select="RecordDate"/></xsl:call-template>
        </xsl:template>
       
        <xsl:template match="CorporateActionOption">
    //<xsl:value-of select="CorporateActionOptionNumber"/>
    OP//<xsl:call-template name="caoptlookup"><xsl:with-param name="codea"  select="CorporateActionOptionsCode"/></xsl:call-template>
    LT//<xsl:call-template name="defproclookup"><xsl:with-param name="codep" select="DefaultProcessingFlag"/></xsl:call-template>
        <xsl:if test="CashPaymentDetails!=''">
    YD//<xsl:value-of select="DefaultProcessingFlag"/>
    S//<xsl:value-of select="CashPaymentDetails/GrossAmountPayable/Currency"/><xsl:value-of select="CashPaymentDetails/GrossAmountPayable/Currency"/>
        </xsl:if>
        <xsl:if test="SecuritiesMovement!=''">
    B//<xsl:call-template name="debcredlookup"><xsl:with-param name="codee" select="DebitCreditIndicator"/></xsl:call-template>
    MOVE
        </xsl:if>
    MOREOUT
        </xsl:template>
       
        <xsl:template name="funcmsglookup">
            <xsl:param name="codef"/>
            <xsl:if test="codef=0"><xsl:text></xsl:text>NEWM</xsl:if>
            <xsl:if test="codef=1"><xsl:text>REPL</xsl:text></xsl:if>
            <xsl:if test="codef=2"><xsl:text>CANC</xsl:text></xsl:if>
        </xsl:template>

        <xsl:template name="caoptlookup">
            <xsl:param name="codea"/>
            <xsl:if test="codea=0"></xsl:if>
            <xsl:if test="codea=1"><xsl:text>CASH</xsl:text></xsl:if>
            <xsl:if test="codea=2"><xsl:text>SECU</xsl:text></xsl:if>
        </xsl:template>

        <xsl:template name="debcredlookup">
            <xsl:param name="codee"/>
            <xsl:if test="codee=0"></xsl:if>
            <xsl:if test="codee=1"><xsl:text>CRED</xsl:text></xsl:if>
            <xsl:if test="codee=2"><xsl:text>DEBT</xsl:text></xsl:if>
        </xsl:template>

        <xsl:template name="dateformat">
            <xsl:param name="adate"/>
            <xsl:text>substring($adate,0,4)substring($adate,5,2)substring($adate,8,2)</xsl:text>
        </xsl:template>
    </xsl:stylesheet>

    Is it me or 0.92?

    Thx.

    David

     
    • Rob

      Rob - 2004-12-06

      click on the triangle with the ! in it. When I run the sheet you posted I get...

      Error on line 6 column 81
        Error reported by XML parser: The element type "xsl:apply-templates" must be terminated by
        the matching end-tag "</xsl:apply-templates>".
      Window::transform: javax.xml.transform.TransformerConfigurationException: Failed to parse stylesheet
      javax.xml.transform.TransformerConfigurationException: Failed to parse stylesheet
          at net.sf.saxon.PreparedStylesheet.loadStylesheetModule(PreparedStylesheet.java:190)
          at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:110)
          at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:129)
          at com.robrohan.fangorn.transform.TreeTransform.transform(Unknown Source)
          at com.robrohan.treebeard.Ent.transform(Ent.java:1133)
          at com.robrohan.treebeard.Ent.access$7(Ent.java:1073)
          at com.robrohan.treebeard.Ent$2.run(Ent.java:568)

      Cheers

       
    • David Wynter

      David Wynter - 2004-12-06

      Hi,

      Sorry, I changed th test.xsl here it is valid. I did not see a trianlge with ! in it anywhere?

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
          <xsl:output method="text" indent="no" encoding="ISO-8859-1"/>
          <xsl:template match="/">
      <xsl:apply-templates select="/CorporateActionAnnouncement/CorporateAction/GeneralInformationBlock"></xsl:apply-templates>
      <xsl:apply-templates select="/CorporateActionAnnouncement/CorporateAction/UnderlyingSecurities"></xsl:apply-templates>
      <xsl:apply-templates select="/CorporateActionAnnouncement/CorporateAction/CorporateActionDetail"></xsl:apply-templates>
      <xsl:apply-templates select="/CorporateActionAnnouncement/CorporateAction/CorporateActionOption"></xsl:apply-templates>
          </xsl:template>

          <xsl:template match="GeneralInformationBlock">
      testoutput<xsl:call-template name="funcmsglookup"><xsl:with-param name="codef" select="FunctionofMessage"/></xsl:call-template>
      moretestoutput
          </xsl:template>

          <xsl:template match="UnderlyingSecurities">
      /<xsl:value-of select="UnderlyingSecurityISIN/Listing"/>/
          </xsl:template>

          <xsl:template match="CorporateActionDetail">
      test//<xsl:call-template name="dateformat"><xsl:with-param name="adate" select="RecordDate"/></xsl:call-template>
          </xsl:template>
         
          <xsl:template match="CorporateActionOption">
      //<xsl:value-of select="CorporateActionOptionNumber"/>
      OP//<xsl:call-template name="caoptlookup"><xsl:with-param name="codea"  select="CorporateActionOptionsCode"/></xsl:call-template>
      LT//<xsl:call-template name="defproclookup"><xsl:with-param name="codep" select="DefaultProcessingFlag"/></xsl:call-template>
          <xsl:if test="CashPaymentDetails!=''">
      YD//<xsl:value-of select="DefaultProcessingFlag"/>
      S//<xsl:value-of select="CashPaymentDetails/GrossAmountPayable/Currency"/><xsl:value-of select="CashPaymentDetails/GrossAmountPayable/Currency"/>
          </xsl:if>
          <xsl:if test="SecuritiesMovement!=''">
      B//<xsl:call-template name="debcredlookup"><xsl:with-param name="codee" select="DebitCreditIndicator"/></xsl:call-template>
      MOVE
          </xsl:if>
      MOREOUT
          </xsl:template>
         
          <xsl:template name="funcmsglookup">
              <xsl:param name="codef"/>
              <xsl:if test="codef=0"><xsl:text></xsl:text>NEWM</xsl:if>
              <xsl:if test="codef=1"><xsl:text>REPL</xsl:text></xsl:if>
              <xsl:if test="codef=2"><xsl:text>CANC</xsl:text></xsl:if>
          </xsl:template>

          <xsl:template name="caoptlookup">
              <xsl:param name="codea"/>
              <xsl:if test="codea=0"></xsl:if>
              <xsl:if test="codea=1"><xsl:text>CASH</xsl:text></xsl:if>
              <xsl:if test="codea=2"><xsl:text>SECU</xsl:text></xsl:if>
          </xsl:template>

          <xsl:template name="debcredlookup">
              <xsl:param name="codee"/>
              <xsl:if test="codee=0"></xsl:if>
              <xsl:if test="codee=1"><xsl:text>CRED</xsl:text></xsl:if>
              <xsl:if test="codee=2"><xsl:text>DEBT</xsl:text></xsl:if>
          </xsl:template>

          <xsl:template name="defproclookup">
              <xsl:param name="codep"/>
              <xsl:if test="codep=0"></xsl:if>
              <xsl:if test="codep=1"><xsl:text>Y</xsl:text></xsl:if>
              <xsl:if test="codep=2"><xsl:text>N</xsl:text></xsl:if>
          </xsl:template>

          <xsl:template name="dateformat">
              <xsl:param name="adate"/>
              <xsl:text>substring($adate,0,4)substring($adate,5,2)substring($adate,8,2)</xsl:text>
          </xsl:template>
      </xsl:stylesheet>

       
    • Rob

      Rob - 2004-12-06

      It should be on the main tool bar - another way to do the same thing is to click on File>Show Errors in the on the main menu bar - the one with Treebeard on the side of it (not in the xslt window)

      Cheers

       
    • David Wynter

      David Wynter - 2004-12-06

      Thx,

      The issue was with the namespace not being declared in the xsl

      David

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.