|
Subject: Re: [xsl] How to move processing instruction? From: George Cristian Bina <george@xxxxxxxxxxxxx> Date: Thu, 12 Apr 2007 10:39:20 +0300 |
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template> <xsl:template match="/">
<xsl:apply-templates select="*"/>
</xsl:template> <xsl:template match="div">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="/processing-instruction()"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
Dear Expert(s): Could anybody help me to get the following results:
INPUT: <?page x?> <?page 1?> <pub-div type="body" id="C7967-10"> <div type="chapter" id="C7967-11"> <div-meta> <lrh>MOVIES AND THE REAGAN PRESIDENCY: SUCCESS AND ETHICS</lrh> <rrh>DEFINING REAGAN-ERA HOLLYWOOD</rrh> </div-meta> <label>Chapter 1</label> <head>Defining Reagan-Era Hollywood</head> <p>xxxx</p> </div> </pub-div>
OUTPUT: <pub-div type="body" id="C7967-10"> <div type="chapter" id="C7967-11"> <?page x?> <?page 1?> <div-meta> <lrh>MOVIES AND THE REAGAN PRESIDENCY: SUCCESS AND ETHICS</lrh> <rrh>DEFINING REAGAN-ERA HOLLYWOOD</rrh> </div-meta> <label>Chapter 1</label> <head>Defining Reagan-Era Hollywood</head> <p>xxxx</p> </div> </pub-div>
XSL:
<xsl:template match="div">
<div>
<xsl:if test="preceding-sibling::processing-instruction('page')">
<xsl:apply-templates select="preceding-sibling::processing-instruction('page')[following-sibling::div[1][@id = current()/@id]]"/>
</xsl:if>
<xsl:apply-templates select="*[not(self::div-meta or self::label or self::head or self::subhead or self::author)]"/>
</xsl:template>
thanks in advance ...Joga S. Rawat
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] How to move processing in, Rashmi Rubdi | Thread | Re: [xsl] How to move processing in, J. S. Rawat |
| Re: [xsl] How to move processing in, Rashmi Rubdi | Date | Re: [xsl] How to move processing in, J. S. Rawat |
| Month |