xml import / include for a match template vs. call?

Discussion in 'XML' started by bjam, Apr 8, 2005.

  1. bjam

    bjam Guest

    Hi, today I was able to abstract out into a separate xsl file a
    template that I specifically perform a call templates for, this worked
    with import no problem. However, when trying to do the same operation
    with a template that I use a match template on, IE was giving me the
    following error for the style sheet. Does anyone know how to import or
    include a match template versus a call named template? Thanks in
    advance for your help

    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error
    and then click the Refresh button, or try again later.


    --------------------------------------------------------------------------------

    Keyword xsl:stylesheet may not contain PCDATA nodes. Error occurred
    during compilation of included or imported stylesheet...


    *** here is the the style sheet for both the import and calling of the
    imported template

    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <!-- import the data output template for displaying each row of resutls
    -->
    <xsl:import href="dqm_dataoutput_template.xsl"/>

    <!-- import the header template for displaying summary header -->
    <xsl:import href="dqm_summary_header_template.xsl"/>

    <!-- root template -->
    <xsl:template match="perldata">
    <!-- open the html -->
    <html>
    <basefont face="Verdana" size="2" />
    <body>

    <!-- apply the HEADER template -->
    <xsl:apply-templates select="hashref/item[@key='HEADER']"/>


    *** below is the imported style sheet

    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    !-- this is the matching template for the header -->
    <xsl:template match="hashref/item[@key='HEADER']">
    <!-- HEADER TITLE -->
    <table border="1" cellpadding="0" cellspacing="0" bgcolor="navy"
    width="35%">
    <tr align="center"> <th colspan="2" backgroud="navy"><font size="3"
    color="white" face="arial"> <xsl:value-of
    select="/perldata/arguments/report_name"/> GROUP
    SUMMARY</font></th></tr>

    <!-- HEADER SECTIONS -->
    <tr align="left">
    <th bgcolor="teal"><font color="#FFFFE6" face="arial" size="2">Report
    Name:</font></th><th bgcolor="#FFFFE6"> <font face="arial" color="teal"
    size="2"><xsl:value-of
    select="/perldata/arguments/report_name"/></font></th>
    </tr>
    <tr align="left">
    <th bgcolor="teal"><font color="#FFFFE6" face="arial" size="2">Last
    Run:</font></th><th bgcolor="#FFFFE6"> <font face="arial" color="teal"
    size="2"><xsl:value-of select="/perldata/arguments/time"/></font></th>
    </tr>
    <tr align="left">
    <th bgcolor="teal"><font color="#FFFFE6" face="arial" size="2">Total
    Tests:</font></th><th bgcolor="#FFFFE6"><font face="arial" color="teal"
    size="2"><xsl:value-of
    select="/perldata/arguments/total_tests"/></font></th>
    </tr>
    </table>
    <!-- for spacing purposes between tests -->
    <table border="0"><tr><td></td></tr><tr><td></td></tr></table>
    <hr/>
    <!-- for spacing purposes between tests -->
    <table border="0"><tr><td></td></tr><tr><td></td></tr></table>
    </xsl:template>

    </xsl:stylesheet>
    bjam, Apr 8, 2005
    #1
    1. Advertising

  2. bjam

    bjam Guest

    Forget it... thanks though... this board is making me help myself as I
    re-read over my message here I noticed a missing bracket.... anyway,
    XML SPY is not that good .... as it did not find this error for me...
    has anyone used XML SPY effectively?? I am pretty new to this tool and
    it sometimes helps and sometimes doesn't. Pretty much gvim and syntax
    highlighting are my code syntax checkers... yours? Thanks again for
    taking the time to read my bablel bable..
    bjam, Apr 8, 2005
    #2
    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. blueblueblue2005
    Replies:
    6
    Views:
    998
    blueblueblue2005
    Jul 19, 2005
  2. Alex Buell
    Replies:
    2
    Views:
    651
    Alex Buell
    Feb 21, 2006
  3. Joseph Turian
    Replies:
    2
    Views:
    848
    Joseph Turian
    Mar 22, 2007
  4. Andreas Bogenberger
    Replies:
    3
    Views:
    899
    Andreas Bogenberger
    Feb 22, 2008
  5. abir
    Replies:
    4
    Views:
    397
Loading...

Share This Page