[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] tag in input document breaks

Subject: [xsl] <param> tag in input document breaks <xsl:copy-of select="." />
From: Evgeny Turnaev <turnaev.e@xxxxxxxxx>
Date: Wed, 3 Jul 2013 12:44:33 +0400

  Dear All, i have searched the web and this mail list and found
nothing related to my question.
  Sorry if this is something obvious and mentioned in xml standard but
this really looks strange to me.

The Question:

Given this input document:
<?xml version="1.0" encoding="UTF-8" ?>
<sometag>Hello world</sometag>

And this simple stylesheet:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="html"/>

<xsl:template match="/">
    <xsl:copy-of select="." />


The output is:

While i expect output:
<sometag>Hello world</sometag>

However changing <param> tag in input document to some other tag fixes
problem and output match expectations.
Also changing <xsl:output method="html"/> to <xsl:output
method="xml"/> fixes problem, but i really want to keep <xsl:output
I have stumbled this while making transform on xml-rpc output: it
starts with <methodResponse><params><param> and all the contents of
<param> tag is missing in output.
Is there something special about <param> tag in input document? I
suppose input document tags should not anyhow change result of
<xsl:copy-of select="." />, is'nt it?

Some technical info:
Transformation code was taken literally as copy of example from page:
and then
gcc ./libxslt_tutorial.c -o ./test_xslt -I/usr/include/libxml2 -lxml2 -lxslt
./test_xslt output.xsl xml_rpc.xml
System: ubuntu 12.04
Linux mtnp 3.2.0-36-generic #57-Ubuntu SMP Tue Jan 8 21:44:52 UTC 2013
x86_64 x86_64 x86_64 GNU/Linux

libxml & libxslt installed via apt-get
Package: libxml2
Priority: standard
Section: libs
Installed-Size: 1745
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@xxxxxxxxxxxxxxxx>
Original-Maintainer: Debian XML/SGML Group
Architecture: amd64
Version: 2.7.8.dfsg-5.1ubuntu4
Depends: libc6 (>= 2.15), zlib1g (>= 1:

Package: libxslt1.1
Priority: optional
Section: libs
Installed-Size: 468
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@xxxxxxxxxxxxxxxx>
Original-Maintainer: Debian XML/SGML Group
Architecture: amd64
Source: libxslt
Version: 1.1.26-8ubuntu1
Depends: libc6 (>= 2.4), libgcrypt11 (>= 1.4.5), libxml2 (>= 2.7.4)

Any thoughts or suggestions?

Current Thread