XML解析错误:标记不匹配。预期:

时间:2015-09-23 16:10:44

标签: xml parsing

我通过输入XML文件在eclipse中运行XSL文件。我清楚地看到在XSL文件中已经关闭了。我检查了其他标签,但似乎定义得很好。你能帮我解决这个错误吗?我已经给出了我在下面使用的文件:     1.引用XSL的XML文件如下:          2. XSL文件,其中包含以下相关信息:               3.使用了jats-preview.css文件     4.引用了overlib.js     5. tooltip.css引用

I have included the code snippets used.

Thanks.


    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "http://jats.nlm.nih.gov/archiving/1.0/JATS-archivearticle1.dtd"[]>
    <?xml-stylesheet type='text/xsl' href='jats-html.xsl'?>
    <article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" article-type="research-article"><?properties open_access?>
<!-- XSL file -->

    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:mml="http://www.w3.org/1998/Math/MathML"
      exclude-result-prefixes="xlink mml">

      <xsl:output doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
        doctype-system="http://www.w3.org/TR/html4/loose.dtd"
        encoding="UTF-8"/>

      <xsl:strip-space elements="*"/>

      <!-- Space is preserved in all elements allowing #PCDATA -->
      <xsl:preserve-space
        elements="abbrev abbrev-journal-title access-date addr-line
                  aff alt-text alt-title article-id article-title
                  attrib award-id bold chapter-title chem-struct
                  collab comment compound-kwd-part compound-subject-part
                  conf-acronym conf-date conf-loc conf-name conf-num
                  conf-sponsor conf-theme contrib-id copyright-holder
                  copyright-statement copyright-year corresp country
                  date-in-citation day def-head degrees disp-formula
                  edition elocation-id email etal ext-link fax fpage
                  funding-source funding-statement given-names glyph-data
                  gov inline-formula inline-supplementary-material
                  institution isbn issn-l issn issue issue-id issue-part
                  issue-sponsor issue-title italic journal-id
                  journal-subtitle journal-title kwd label license-p
                  long-desc lpage meta-name meta-value mixed-citation
                  monospace month named-content object-id on-behalf-of
                  overline p page-range part-title patent person-group
                  phone prefix preformat price principal-award-recipient
                  principal-investigator product pub-id publisher-loc
                  publisher-name related-article related-object role
                  roman sans-serif sc season self-uri series series-text
                  series-title sig sig-block size source speaker std
                  strike string-name styled-content std-organization
                  sub subject subtitle suffix sup supplement surname
                  target td term term-head tex-math textual-form th
                  time-stamp title trans-source trans-subtitle trans-title
                  underline uri verse-line volume volume-id volume-series
                  xref year
                  mml:annotation mml:ci mml:cn mml:csymbol mml:mi mml:mn 
                  mml:mo mml:ms mml:mtext"/>

      
      <xsl:param name="transform" select="'jats-html.xsl'"/>

      <xsl:param name="css" select="'jats-preview.css'"/>
      
      <xsl:param name="report-warnings" select="'no'"/>
      
      <xsl:variable name="verbose" select="$report-warnings='yes'"/>
      
      <!-- Keys -->

      <!-- To reduce dependency on a DTD for processing, we declare
           a key to use instead of the id() function. -->
      <xsl:key name="element-by-id" match="*[@id]" use="@id"/>

      <!-- Enabling retrieval of cross-references to objects -->
      <xsl:key name="xref-by-rid" match="xref" use="@rid"/>
      
      <!-- ============================================================= -->
      <!--  ROOT TEMPLATE - HANDLES HTML FRAMEWORK                       -->
      <!-- ============================================================= -->

      <xsl:template match="/">
        <html>
          <!-- HTML header -->
          <xsl:call-template name="make-html-header"/>
          <body>
            <xsl:apply-templates/>
          </body>
        </html>
      </xsl:template>


      <xsl:template name="make-html-header">
        <head>
          <title>
            <xsl:variable name="authors">
              <xsl:call-template name="author-string"/>
            </xsl:variable>
            <xsl:value-of select="normalize-space(string($authors))"/>
            <xsl:if test="normalize-space(string($authors))">: </xsl:if>
            <xsl:value-of
              select="/article/front/article-meta/title-group/article-title[1]"/>
          </title>
          <link rel="stylesheet" type="text/css" href="{$css}"/>
          <!-- XXX check: any other header stuff? XXX -->
        </head>
      </xsl:template>


    <!-- ============================================================= -->
    <!--  TOP LEVEL                                                    -->
    <!-- ============================================================= -->

      <!--
          content model for article:
             (front,body?,back?,floats-group?,(sub-article*|response*))
          
          content model for sub-article:
             ((front|front-stub),body?,back?,floats-group?,
              (sub-article*|response*))
          
          content model for response:
             ((front|front-stub),body?,back?,floats-group?) -->
      
      <xsl:template match="article">
        <xsl:call-template name="make-article"/>
      </xsl:template>

      <xsl:template match="sub-article | response">
        <hr class="part-rule"/>
        <xsl:call-template name="make-article"/>
      </xsl:template>


    <!-- ============================================================= -->
    <!--  "make-article" for the document architecture                 -->
    <!-- ============================================================= -->

      <xsl:template name="make-article">
        <!-- Generates a series of (flattened) divs for contents of any
    	       article, sub-article or response -->

        <!-- variable to be used in div id's to keep them unique -->
        <xsl:variable name="this-article">
          <xsl:apply-templates select="." mode="id"/>
        </xsl:variable>

        <div id="{$this-article}-front" class="front">
          <xsl:apply-templates select="front | front-stub"/>
        </div>

        <!-- body -->
        <xsl:for-each select="body">
          <div id="{$this-article}-body" class="body">
            <xsl:apply-templates/>
          </div>
        </xsl:for-each>

        <xsl:if test="back | $loose-footnotes">
          <!-- $loose-footnotes is defined below as any footnotes outside
               front matter or fn-group -->
          <div id="{$this-article}-back" class="back">
            <xsl:call-template name="make-back"/>
          </div>
        </xsl:if>

        <xsl:for-each select="floats-group | floats-wrap">
          <!-- floats-wrap is from 2.3 -->
          <div id="{$this-article}-floats" class="back">
            <xsl:call-template name="main-title">
              <xsl:with-param name="contents">
                <span class="generated">Floating objects</span>
              </xsl:with-param>
            </xsl:call-template>
            <xsl:apply-templates/>
          </div>
        </xsl:for-each>

        <!-- more metadata goes in the footer -->
        <div id="{$this-article}-footer" class="footer">
          <xsl:call-template name="footer-metadata"/>
          <xsl:call-template name="footer-branding"/>
        </div>

        <!-- sub-article or response (recursively calls
    		     this template) -->
        <xsl:apply-templates select="sub-article | response"/>

      </xsl:template>


    <!-- ============================================================= -->
    <!--  End stylesheet                                               -->
    <!-- ============================================================= -->

    </xsl:stylesheet>

0 个答案:

没有答案