Hi,
My match rules are not fired (though they should)--can anyone help
me please?
XML File trail.xml contents:
---------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<COURTCASE xmlns:lnv="http://www.lexis-nexis.com/lnv"
xmlns:lnvxe="http://www.lexis-nexis.com/lnvxe"
xmlns:lnci="http://www.lexis-nexis.com/lnci">
<lnv:CITE><cite4thisdoc>174 S.W.3d
70</cite4thisdoc><cite4thisdoc>2005 Tenn. App. LEXIS
196</cite4thisdoc></lnv:CITE>
<lnv:DISSENTS>
<lnvxe:dissent><p><lnvxe:text>DeGenaro, J., concurring in part and
dissenting in part:</lnvxe:text></p><p
i="3"><lnvxe:text><lnvxe:reasonforciting
rfctoken="I4J2JVVG0K1MNJ2WV0000400"><lnvxe:reasonforciting
rfctoken="I4J2JVVG0K1MNJ2XD0000400"><page count="P43" rsc="3359"/>
While I concur with the majority's resolution of Appellant's
first two assignments of error, I write separately because I
respectfully disagree with the majority's resolution of
Appellant's third assignment of error. As the majority has
acknowledged, the Ohio Supreme Court held oral arguments on July 26,
2005 in the consolidated cases of <lnvxe:rfc-anchorcite
rfc-anchorid="I4J2JVVG0K1MNJ2WT0000400"
lni="4D2P-PSD0-0039-44R6-00000-00"
rfctokenref="I4J2JVVG0K1MNJ2WV0000400" status="valid"><lnci:cite
ID="I4HXGY0R0K1MNJ47G0000400" ri.key="46573951"
status="valid"><lnci:case><lnci:caseinfo><lnci:casename><lnci:party1
name="State"/><lnci:text txt="v."/><lnci:party2
name="Foster"/></lnci:casename></lnci:caseinfo><lnci:caseref
ID="I4HXGY0R0K1MNJ47F0000400"><lnci:reporter normpubcode="31491"
value="Ohio"/><lnci:volume num="2004"></lnci:volume><lnci:page
num="4209"/></lnci:caseref><lnci:caseref ID="I4HXGY0R0K1MNJ5430000400"
exclude="1" generated="1"><lnci:reporter normpubcode="4048" value="Ohio
App. LEXIS"/><lnci:volume num="2004"></lnci:volume><lnci:page
num="3815"/></lnci:caseref></lnci:case><lnci:metadata><lnci:precedent><lnci:editletter
ID="I4HXGY0R0K1MNJ54F0000400" letter="j" appliedby="machine"
comment="Cited in dissenting opinion
at"/></lnci:precedent></lnci:metadata><lnci:content><emph
typestyle="it">State v. Foster,</emph> 5th Dist. No. 03CA95, 2004 Ohio
4209</lnci:content></lnci:cite></lnvxe:rfc-anchorcite> (Supreme Court
Case No. 2004-1568), and <lnvxe:rfc-anchorcite
rfc-anchorid="I4J2JVVG0K1MNJ2WW0000400"
lni="4D5X-8HC0-0039-426M-00000-00"
rfctokenref="I4J2JVVG0K1MNJ2WV0000400" status="valid"><lnci:cite
ID="I4HXGY0R0K1MNJ47J0000400" ri.key="46768047"
status="valid"><lnci:case><lnci:caseinfo><lnci:casename><lnci:party1
name="State"/><lnci:text txt="v."/><lnci:party2
name="Quinones"/></lnci:casename></lnci:caseinfo><lnci:caseref
ID="I4HXGY0R0K1MNJ47H0000400"><lnci:reporter normpubcode="31491"
value="Ohio"/><lnci:volume num="2004"></lnci:volume><lnci:page
num="4485"/></lnci:caseref><lnci:caseref ID="I4HXGY0R0K1MNJ5440000400"
exclude="1" generated="1"><lnci:reporter normpubcode="4048" value="Ohio
App. LEXIS"/><lnci:volume num="2004"></lnci:volume><lnci:page
num="4072"/></lnci:caseref></lnci:case><lnci:metadata><lnci:precedent><lnci:editletter
ID="I4HXGY0R0K1MNJ54G0000400" letter="j" appliedby="machine"
comment="Cited in dissenting opinion
at"/></lnci:precedent></lnci:metadata><lnci:content><emph
typestyle="it">State v. Quinones,</emph> 8th Dist. No. 83720, 2004 Ohio
4485</lnci:content></lnci:cite><lnvxe:lnhnnum
hnnumtoken="I4J2JVVG0K1MNJ4N20000400"
hnnum="7"/></lnvxe:rfc-anchorcite> (Supreme Court Case No. 2004-1771),
to resolve<page count="19" rsc="7351"/> the issue of whether
<lnvxe:rfc-anchorcite rfc-anchorid="I4J2JVVG0K1MNJ2X90000400"
lni="4CPD-37G0-004C-000B-00000-00"
rfctokenref="I4J2JVVG0K1MNJ2WV0000400" status="valid"><lnci:cite
ID="I4HXGY0R0K1MNJ47M0000400" ri.key="45884200"
status="valid"><lnci:case><lnci:caseinfo><lnci:casename><lnci:party1
name="Blakely"/><lnci:text txt="v."/><lnci:party2
name="Washington"/></lnci:casename><lnci:decisiondate
txt="2004"/></lnci:caseinfo><lnci:caseref
ID="I4HXGY0R0K1MNJ47N0000400"><lnci:reporter normpubcode="52"
value="U.S."/><lnci:volume num="542"></lnci:volume><lnci:page
num="296"/></lnci:caseref><lnci:caseref
ID="I4HXGY0R0K1MNJ47R0000400"><lnci:reporter normpubcode="656"
value="S.Ct."/><lnci:volume num="124"></lnci:volume><lnci:page
num="2531"/></lnci:caseref><lnci:caseref
ID="I4HXGY0R0K1MNJ47T0000400"><lnci:reporter normpubcode="285"
value="L.Ed.2d"/><lnci:volume num="159"></lnci:volume><lnci:page
num="403"/></lnci:caseref><lnci:caseref ID="I4HXGY0R0K1MNJ5450000400"
exclude="1" generated="1"><lnci:reporter normpubcode="4112" value="U.S.
LEXIS"/><lnci:volume num="2004"></lnci:volume><lnci:page
num="4573"/></lnci:caseref><lnci:caseref ID="I4HXGY0R0K1MNJ5460000400"
exclude="1" generated="1"><lnci:reporter normpubcode="669"
value="U.S.L.W."/><lnci:volume num="72"></lnci:volume><lnci:page
num="4546"/></lnci:caseref><lnci:caseref ID="I4HXGY0R0K1MNJ5470000400"
exclude="1" generated="1"><lnci:reporter normpubcode="3202" value="Fla.
L. Weekly Fed. S"/><lnci:volume num="17"></lnci:volume><lnci:page
num="430"/></lnci:caseref><lnci:caseref ID="I4JCCPPS0K1MNJ22R0000400"
exclude="1" generated="1"><lnci:reporter normpubcode="37003"
value="A.L.R. Fed. 2d"/><lnci:volume num="6"></lnci:volume><lnci:page
num="619"/></lnci:caseref></lnci:case><lnci:metadata><lnci:precedent><lnci:editletter
ID="I4HXGY0R0K1MNJ54H0000400" letter="j" appliedby="machine"
comment="Cited in dissenting opinion
at"/></lnci:precedent></lnci:metadata><lnci:content><emph
typestyle="it">Blakely v. Washington</emph> (2004), 542 U.S. 296, 124
S.Ct. 2531, 159 L.Ed.2d
403</lnci:content></lnci:cite></lnvxe:rfc-anchorcite> applies to
Ohio's felony sentencing scheme. The majority holds that <emph
typestyle="it">Blakely</emph> does not apply, primarily relying upon
this court's prior decision in <lnvxe:rfc-anchorcite
rfc-anchorid="I4J2JVVG0K1MNJ2XC0000400"
lni="4F62-HND0-TVW7-G2BH-00000-00"
rfctokenref="I4J2JVVG0K1MNJ2XD0000400" status="valid"><lnci:cite
ID="I4HXGY0R0K1MNJ47X0000400" ri.key="48110228" loadable="1"
historycite="0"
status="valid"><lnci:case><lnci:caseinfo><lnci:casename><lnci:party1
name="State"/><lnci:text txt="v."/><lnci:party2
name="Barnette"/></lnci:casename></lnci:caseinfo><lnci:caseref
ID="I4HXGY0R0K1MNJ4810000400" exclude="0" generated="0"><lnci:reporter
normpubcode="31491" value="Ohio"/><lnci:volume
num="2004"></lnci:volume><lnci:page
num="7211"/></lnci:caseref><lnci:caseref ID="I4HXJPY60K1MNJ34D0000400"
exclude="1" generated="1"><lnci:reporter normpubcode="4048" value="Ohio
App. LEXIS"/><lnci:volume num="2004"></lnci:volume><lnci:page
num="6691"/></lnci:caseref></lnci:case><lnci:metadata><lnci:precedent><lnci:editletter
ID="I4HXJW5N0K1MNJ1S20000400" letter="j" appliedby="machine"
comment="Cited in dissenting opinion
at"/></lnci:precedent></lnci:metadata><lnci:content><emph
typestyle="it">State v. Barnette,</emph> 7th Dist. No. 02 CA 65, 2004
Ohio 7211</lnci:content></lnci:cite><lnvxe:lnhnnum
hnnumtoken="I4J2JVVG0K1MNJ4N30000400" hnnum="27"/><lnvxe:lnhnnum
hnnumtoken="I4J2JVVG0K1MNJ4N40000400" hnnum="31"/><lnvxe:lnhnnum
hnnumtoken="I4J2JVVG0K1MNJ4N50000400"
hnnum="33"/></lnvxe:rfc-anchorcite>.
</lnvxe:reasonforciting></lnvxe:reasonforciting>I dissented from that
decision and will continue to do so whenever appropriate until the Ohio
Supreme Court has resolved the issue, especially since, as the majority
acknowledges, the Ohio Supreme Court has accepted and held <emph
typestyle="it">Barnette's</emph> appeal, as well as many others,
until <emph typestyle="it">Foster</emph> and <emph
typestyle="it">Quinones</emph> are
decided.</lnvxe:text></p><p><lnvxe:text><page count="P44" rsc="3359"/>
Accordingly, I would reverse Appellant's sentence and remand this
case for resentencing.</lnvxe:text></p></lnvxe:dissent>
<lnvxe:dissent><p><table><tgroup cols="2"><colspec colname="col1"
colwidth="256"/><colspec colname="col2"
colwidth="120"/><tbody><row><entry colname="col1" align="left">1.
Attorney Fees</entry></row><row><entry colname="col1" align="left">
L. Caesar Stair, III</entry><entry colname="col2" align="right"> n3
$7,047.50</entry></row><row><entry colname="col1" align="left"> Bill
Phillips</entry><entry colname="col2"
align="right">850.00</entry></row><row><entry colname="col1"
align="left"/></row></tbody></tgroup></table></p></lnvxe:dissent>
</lnv:DISSENTS>
</COURTCASE>
XSL File trail.xsl contents:
---------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lnv="http://www.lexis-nexis.com/lnv"
xmlns:lnvxe="http://www.lexis-nexis.com/lnvxe"
xmlns:lndocmeta="http://www.lexis-nexis.com/lndocmeta"
xmlns:fff="http://www.lexisnexis.com/namespace/sslrp/ecomp/fff"
xmlns:xd="http://www.pnp-software.com/XSLTdoc"
xmlns:xalan="http://xml.apache.org/xalan"
exclude-result-prefixes="xsl lnv lnvxe lndocmeta xd str
xalan">
<xsl:template match="/">
<xsl:element name="fff:fff">
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<xsl:template match="COURTCASE">
<xsl:variable name="citeText">
<xsl:apply-templates select="lnv:CITE/cite4thisdoc[1]" />
</xsl:variable>
<xsl:variable name="citeGroup">
<xsl:call-template name="createCiteGroup">
<xsl:with-param name="citeText" select="$citeText" />
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="Dissent">
<xsl:with-param name="citeGroup" select="$citeGroup" />
</xsl:call-template>
</xsl:template>
<xsl:template name="Dissent">
<xsl:param name="citeGroup"/>
<xsl:choose>
<xsl:when test="lnv:DISSENTS">
<xsl:apply-templates select="lnvxe:dissent">
<xsl:with-param name="citeGroup" select="$citeGroup" />
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="lnvxe:dissent">
<xsl:param name="citeGroup"/>
<xsl:apply-templates>
<xsl:with-param name="citeGroup"
select="$citeGroup"></xsl:with-param>
</xsl:apply-templates>
</xsl:template>
<xsl:template name="p">
<xsl:param name="citeGroup"/>
<xsl:choose>
<xsl:when test="parent::lnvxe:dissent">
<xsl:element name="fff:cr"/>
<xsl:element name="fff:paraStyle">
<xsl:attribute name="name">
<xsl:text>ParaInd1</xsl:text>
</xsl:attribute>
</xsl:element>
<xsl:copy-of select="$citeGroup" />
<xsl:element name="fff:group">
<xsl:attribute name="name">
<xsl:text>dissent</xsl:text>
</xsl:attribute>
</xsl:element>
<xsl:apply-templates select="."/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="createCiteGroup">
<xsl:param name="citeText" />
<xsl:element name="fff:group">
<xsl:attribute name="name">
<xsl:copy-of select="$citeText" />
</xsl:attribute>
</xsl:element>
</xsl:template>
<xsl:template match="table">
<xsl:param name="citeGroup"/>
<xsl:copy-of select ="."/>
</xsl:template>
</xsl:stylesheet>
I am running the folowing command:
----------------------------------------------------
java org.apache.xalan.xslt.Process -in
D:\workspace\Klondike\XSLT\Input_File
s\trial.xml -xsl D:\workspace\Klondike\XSLT\StyleSheets\trial.xsl -out
D:\worksp
ace\Klondike\XSLT\Input_Files\trial_trial.xml
which is producing me output file (trial_trial.xml)--contents are:
-----------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<fff:fff
xmlns:fff="http://www.lexisnexis.com/namespace/sslrp/ecomp/fff"/>
dickster - 30 Mar 2006 10:30 GMT
In your xml your root COURTCASE element is not prefixed
but you dont have a default namespace
perhaps add one in and you will get more output
<COURTCASE
xmlns="some-urn"
xmlns:lnv="http://www.lexis-nexis.com/lnv"
xmlns:lnvxe="http://www.lexis-nexis.com/lnvxe"
xmlns:lnci="http://www.lexis-nexis.com/lnci">
I used xalan and noticed i got an error with "str" in
exclude-result-prefixes="xsl lnv lnvxe lndocmeta xd str xalan"
I had to remove it as well.
exclude-result-prefixes="xsl lnv lnvxe lndocmeta xd xalan"
Dickster
Ankush - 30 Mar 2006 10:52 GMT
Thanks Dickster,
I corrected these but still my match rules are not fired.
Here is a shorter version of the problem:
XML File:
--------------
<?xml version="1.0" encoding="UTF-8"?>
<COURTCASE xmlns="Ankush" xmlns:lnv="http://www.lexis-nexis.com/lnv"
xmlns:lnvxe="http://www.lexis-nexis.com/lnvxe"
xmlns:lnci="http://www.lexis-nexis.com/lnci">
<lnv:CITE><cite4thisdoc>174 S.W.3d
70</cite4thisdoc><cite4thisdoc>2005 Tenn. App. LEXIS
196</cite4thisdoc></lnv:CITE>
<lnv:DISSENTS>
<lnvxe:dissent><p><lnvxe:text>DeGenaro, J., concurring in part and
dissenting in part:</lnvxe:text></p></lnvxe:dissent>
<lnvxe:dissent><p><table><tgroup cols="2"><colspec colname="col1"
colwidth="256"/><colspec colname="col2"
colwidth="120"/><tbody><row><entry colname="col1" align="left">1.
Attorney Fees</entry></row><row><entry colname="col1" align="left">
L. Caesar Stair, III</entry><entry colname="col2" align="right"> n3
$7,047.50</entry></row><row><entry colname="col1" align="left"> Bill
Phillips</entry><entry colname="col2"
align="right">850.00</entry></row><row><entry colname="col1"
align="left"/></row></tbody></tgroup></table></p></lnvxe:dissent>
</lnv:DISSENTS>
</COURTCASE>
XSL File:
--------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lnv="http://www.lexis-nexis.com/lnv"
xmlns:lnvxe="http://www.lexis-nexis.com/lnvxe"
xmlns:fff="http://www.lexisnexis.com/namespace/sslrp/ecomp/fff"
xmlns:xalan="http://xml.apache.org/xalan"
exclude-result-prefixes="xsl lnv lnvxe xalan">
<xsl:template match="/">
<xsl:element name="fff:fff">
<xsl:apply-templates />
</xsl:element>
</xsl:template>
<xsl:template match="COURTCASE">
<xsl:variable name="citeGroup">
<xsl:element name="fff:group">
<xsl:attribute name="name">
<xsl:copy-of select="lnv:CITE/cite4thisdoc[1]" />
</xsl:attribute>
</xsl:element>
</xsl:variable>
<xsl:call-template name="Dissent">
<xsl:with-param name="citeGroup" select="$citeGroup" />
</xsl:call-template>
</xsl:template>
<xsl:template name="Dissent">
<xsl:param name="citeGroup"/>
<xsl:choose>
<xsl:when test="lnv:DISSENTS">
<xsl:copy-of select="$citeGroup" />
<xsl:apply-templates select="lnvxe:dissent">
<xsl:with-param name="citeGroup" select="$citeGroup" />
</xsl:apply-templates>
<xsl:copy-of select="$citeGroup" />
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="lnvxe:dissent">
<xsl:param name="citeGroup"/>
<xsl:apply-templates>
<xsl:with-param name="citeGroup"
select="$citeGroup"></xsl:with-param>
</xsl:apply-templates>
</xsl:template>
<xsl:template name="p">
<xsl:param name="citeGroup"/>
<xsl:choose>
<xsl:when test="parent::lnvxe:dissent">
<xsl:element name="fff:cr"/>
<xsl:element name="fff:paraStyle">
<xsl:attribute name="name">
<xsl:text>ParaInd1</xsl:text>
</xsl:attribute>
</xsl:element>
<xsl:copy-of select="$citeGroup" />
<xsl:element name="fff:group">
<xsl:attribute name="name">
<xsl:text>dissent</xsl:text>
</xsl:attribute>
</xsl:element>
<xsl:apply-templates select="."/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="table">
<xsl:param name="citeGroup"/>
<xsl:copy-of select ="."/>
</xsl:template>
</xsl:stylesheet>
Output Obtained:
-------------------------
<?xml version="1.0" encoding="UTF-8"?>
<fff:fff
xmlns:fff="http://www.lexisnexis.com/namespace/sslrp/ecomp/fff">
174 S.W.3d 702005 Tenn. App. LEXIS 196
DeGenaro, J., concurring in part and dissenting in part:
1. Attorney Fees L. Caesar Stair, III n3 $7,047.50 Bill
Phillips850.00
</fff:fff>
Martin Honnen - 30 Mar 2006 14:16 GMT
> <COURTCASE xmlns="Ankush" xmlns:lnv="http://www.lexis-nexis.com/lnv"
^^^^^^^^^^^^^^
See
<http://www.faqts.com/knowledge_base/view.phtml/aid/34022/fid/616> on
how to write an XPath expression to match elements in the default namespace.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Ankush - 30 Mar 2006 15:59 GMT
I got the problem! I was sillly to write <xsl:template
name="blah-blah"> instead of <xsl:template match="blah-blah"> to match
xml elements.
As for default namespace I just need to remove xmlns="Ankush" from my
xml file and it should work for me.
Anyway, it was nice to see this article. I will read it in full some
other time. Thanks for sharing this with me. I am a novice in XSLT and
thus seem to make more silly mistakes than others.
Thanks again
Ankush
Martin Honnen - 30 Mar 2006 16:18 GMT
> As for default namespace I just need to remove xmlns="Ankush" from my
> xml file and it should work for me.
Changing the XML to remove xmlns is usually not the right way to solve
the problem but rather an attempt to circumvent the problem.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
dickster - 30 Mar 2006 16:33 GMT
Hi Martin - read the article which has helped clear up some confusion
on namespaces for me.. thanks!
So by implication Ankush should go with something like the following??
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lnv="http://www.lexis-nexis.com/lnv"
xmlns:lnvxe="http://www.lexis-nexis.com/lnvxe"
xmlns:fff="http://www.lexisnexis.com/namespace/sslrp/ecomp/fff"
xmlns:xalan="http://xml.apache.org/xalan"
exclude-result-prefixes="xsl lnv lnvxe pf xalan"
xmlns:pf="Ankush"
<xsl:template match="/">
<xsl:element name="fff:fff">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template name="pf:COURTCASE">
<xsl:variable name="citeGroup">
<xsl:element name="fff:group">
<xsl:attribute name="name">
<xsl:copy-of select="lnv:CITE/cite4thisdoc[1]"/></xsl:attribute>
</xsl:element>
</xsl:variable>
<xsl:call-template name="pf:Dissent">
<xsl:with-param name="citeGroup" select="$citeGroup"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="pf:Dissent">
<xsl:param name="citeGroup"/>
<xsl:choose>
<xsl:when test="lnv:DISSENTS">
<xsl:copy-of select="$citeGroup"/>
<xsl:apply-templates select="lnvxe:dissent">
<xsl:with-param name="citeGroup" select="$citeGroup"/>
</xsl:apply-templates>
<xsl:copy-of select="$citeGroup"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="lnvxe:dissent">
<xsl:param name="citeGroup"/>
<xsl:apply-templates>
<xsl:with-param name="citeGroup" select="$citeGroup"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template name="pf:p">
<xsl:param name="citeGroup"/>
<xsl:choose>
<xsl:when test="parent::lnvxe:dissent">
<xsl:element name="fff:cr"/>
<xsl:element name="fff:paraStyle">
<xsl:attribute
name="name"><xsl:text>ParaInd1</xsl:text></xsl:attribute>
</xsl:element>
<xsl:copy-of select="$citeGroup"/>
<xsl:element name="fff:group">
<xsl:attribute
name="name"><xsl:text>dissent</xsl:text></xsl:attribute>
</xsl:element>
<xsl:apply-templates select="."/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="pf:table">
<xsl:param name="citeGroup"/>
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
>Changing the XML to remove xmlns is usually not the right way to solve
>the problem but rather an attempt to circumvent the problem.
Can you elaborate or point in the direction of good documentation to
explain the reasoning behind this?
dickster - 30 Mar 2006 16:35 GMT
Hi Martin - read the article which has helped clear up some confusion
on namespaces for me.. thanks!
So by implication Ankush should go with something like the following??
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lnv="http://www.lexis-nexis.com/lnv"
xmlns:lnvxe="http://www.lexis-nexis.com/lnvxe"
xmlns:fff="http://www.lexisnexis.com/namespace/sslrp/ecomp/fff"
xmlns:xalan="http://xml.apache.org/xalan"
exclude-result-prefixes="xsl lnv lnvxe pf xalan"
xmlns:pf="Ankush">
<xsl:template match="/">
<xsl:element name="fff:fff">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template name="pf:COURTCASE">
<xsl:variable name="citeGroup">
<xsl:element name="fff:group">
<xsl:attribute name="name">
<xsl:copy-of
select="lnv:CITE/cite4thisdoc[1]"/></xsl:attribute>
</xsl:element>
</xsl:variable>
<xsl:call-template name="pf:Dissent">
<xsl:with-param name="citeGroup"
select="$citeGroup"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="pf:Dissent">
<xsl:param name="citeGroup"/>
<xsl:choose>
<xsl:when test="lnv:DISSENTS">
<xsl:copy-of select="$citeGroup"/>
<xsl:apply-templates
select="lnvxe:dissent">
<xsl:with-param
name="citeGroup" select="$citeGroup"/>
</xsl:apply-templates>
<xsl:copy-of select="$citeGroup"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="lnvxe:dissent">
<xsl:param name="citeGroup"/>
<xsl:apply-templates>
<xsl:with-param name="citeGroup"
select="$citeGroup"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template name="pf:p">
<xsl:param name="citeGroup"/>
<xsl:choose>
<xsl:when test="parent::lnvxe:dissent">
<xsl:element name="fff:cr"/>
<xsl:element name="fff:paraStyle">
<xsl:attribute
name="name"><xsl:text>ParaInd1</xsl:text></xsl:attribute>
</xsl:element>
<xsl:copy-of select="$citeGroup"/>
<xsl:element name="fff:group">
<xsl:attribute
name="name"><xsl:text>dissent</xsl:text></xsl:attribute>
</xsl:element>
<xsl:apply-templates select="."/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="pf:table">
<xsl:param name="citeGroup"/>
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
>Changing the XML to remove xmlns is usually not the right way to solve
>the problem but rather an attempt to circumvent the problem.
Can you elaborate or point in the direction of good documentation to
explain the reasoning behind this?
Martin Honnen - 30 Mar 2006 17:03 GMT
> So by implication Ankush should go with something like the following??
>
> <xsl:stylesheet
> xmlns:pf="Ankush">
Yes, some prefix has to be declared in the stylesheet for what is the
(or a) default namespace in the source XML.
Then that prefix has to be used, as you do here
> <xsl:template name="pf:COURTCASE">
correctly.
> <xsl:call-template name="pf:Dissent">
The name attribute value is not an XPath expression nor a match pattern
so there is no need to change that to a qualified name. It works just as
fine with using
<xsl:call-template name="Dissent">
as it already was in the original stylesheet.
>>Changing the XML to remove xmlns is usually not the right way to solve
>>the problem but rather an attempt to circumvent the problem.
>
> Can you elaborate or point in the direction of good documentation to
> explain the reasoning behind this?
The reasoning why I say "changing the XML to remove xmlns is usually not
the right way"? Well namespaces in XML give the XML semantics and if you
remove a namespace declaration then you change the semantics. And if the
reason for that change is that you do not know of a simple technique to
write a stylesheet to match/select elements in a default namespace then
I think the solution is to learn that technique and not to make changes
of the semantics of the source/input XML.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
dickster - 30 Mar 2006 23:33 GMT
Martin
Thanks for answering this.
Dickster