XSLT用于从文件中获取内容,其中该文件名以' demo.xml'只要

时间:2014-05-22 12:43:10

标签: xslt

请建议从那些XML中取出内容,这个文件名以'demo.xml'结尾,我需要获取特定元素或内容。请建议,在这里我使用'*'方法和'* demo.xml'来查找以单词demo结尾的特定文件。

XML: 2830_demo.xml

<article>
  <head>
       <title>Space Technologies</title>
       <author-group>
         <au>Rudramuni</au>
       </author-group>
  </head>
  <body><p>The first para</p></body></article>

XSLT:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:variable name="varCollection">
       <xsl:copy-of select="collection('file:///D:/Rudramuni/XSLT/Samples/Documents/JVIR?select=*demo.xml;recurse=yes')"/>
    </xsl:variable>
     <xsl:template match="*"><xsl:apply-templates/></xsl:template>
    <xsl:template match="article1">
      <xsl:for-each select="$varCollection">
        <xsl:variable name="a" select="."/>
          <aug><xsl:apply-templates select="$a/article/head/ceauthor-group"/></aug>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

0 个答案:

没有答案