Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <!DOCTYPE document [
- <!ELEMENT document (employee)*>
- <!ELEMENT employee (lastname, firstname)>
- <!ELEMENT lastname (#PCDATA)>
- <!ELEMENT firstname (#PCDATA)>
- <!NOTATION FOO SYSTEM 'text/xml'>
- <!ENTITY ATTACHMENT SYSTEM 'attach.xml' NDATA FOO>
- <!ATTLIST employee
- detail ENTITY #IMPLIED>
- ]>
- <document>
- <employee detail="ATTACHMENT">
- <lastname>Bob</lastname>
- <firstname>Kevin</firstname>
- </employee>
- </document>
- <?xml version="1.0" encoding="UTF-8"?>
- <name>Bob Kevin</name>
- <?xml version="1.0"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml" indent="yes"/>
- <xsl:template match="document">
- <Document>
- <xsl:apply-templates select="employee"/>
- </Document>
- </xsl:template>
- <xsl:template match="employee">
- Employee is: <xsl:value-of select="@detail"/>
- </xsl:template>
- </xsl:stylesheet>
- java -jar xalan.jar -IN doc.xml -XSL doc.xsl -OUT docout.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <Document>
- Employee is: ATTACHMENT
- </Document>
- <?xml version="1.0" encoding="UTF-8"?>
- <Document>
- Employee is: <name>Bob Kevin</name>
- </Document>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
- <xsl:output method="xml" indent="yes"/>
- <xsl:template match="document">
- <Document>
- <xsl:apply-templates select="employee"/>
- </Document>
- </xsl:template>
- <xsl:template match="employee">
- Employee is: <xsl:value-of select=
- "unparsed-text(unparsed-entity-uri(@detail))"/>
- </xsl:template>
- </xsl:stylesheet>
- <?xml version="1.0"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml" indent="yes"/>
- <xsl:template match="document">
- <Document>
- <xsl:apply-templates select="employee"/>
- </Document>
- </xsl:template>
- <xsl:template match="employee">
- Employee is: <xsl:copy-of select="document(unparsed-entity-uri(@detail))"/>
- </xsl:template>
- </xsl:stylesheet>
- <xsl:copy-of select="document(unparsed-entity-uri(@detail))"/>
Add Comment
Please, Sign In to add comment