[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[xml] Problems with Xinclude and Xpointer in xsltproc



I am trying to merge parts of one document into another with xsltproc, using Xinclude and Xpointer attribute.

xsltproc -V
Using libxml 20614CVS2190, libxslt 10111CVS955 and libexslt 809CVS955
xsltproc was compiled against libxml 20614, libxslt 10111 and libexslt 809
libxslt 10111 was compiled against libxml 20614
libexslt 809 was compiled against libxml 20614

It works accept for the shorthand notation for Xpointer, using the ID attribute of the included portion of the document.

mybook.xml includes elements from mychapter.xml

xinclude.xsl just copies input to output.

The problem is seen in result.xml, where the last xi:include uses an id value in the xpointer attribute.

This should be OK with the Xinclude spec?

Thanks,
Vidar Sørensen
Kongsberg defence & Aerospace
Kongsberg
Norway

Attachment: xinclude.xsl
Description: xinclude.xsl

<?xml version="1.0" encoding="UTF-8"?>
<chapter>
	<title>My chapter</title>
	<section>
		<title>My Chapter Section 1</title>
		<para>This is the text of section 1</para>
	</section>
	<section>
		<title>My Chapter Section 2</title>
		<para>This is the text of section 2</para>
	</section>
	<section id="section3">
		<title>My chapter Section 3</title>
		<para>Section with ID</para>
	</section>
</chapter>
<?xml version="1.0"?>
<!-- edited with XMLSpy v2005 sp1 U (http://www.xmlspy.com) by Terje Frebergsvik (Kongsberg Defence & Aerospace AS) -->
<book>
	<title>My Book</title>
	<chapter>
		<title>My first chapter</title>
		<section>
		<title>My Chapter Section 1</title>
		<para>This is the text of section 1</para>
	</section>
		<section>
			<title>Section 1</title>
			<para>Local to mybook</para>
		</section>
		<section>
		<title>My Chapter Section 2</title>
		<para>This is the text of section 2</para>
	</section>
		<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"; href="mychapter.xml" xpointer="section3"/>
	</chapter>
</book>
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 sp1 U (http://www.xmlspy.com) by Terje Frebergsvik (Kongsberg Defence & Aerospace AS) -->
<book>
	<title>My Book</title>
	<chapter>
		<title>My first chapter</title>
		<xi:include href="mychapter.xml" xmlns:xi="http://www.w3.org/2001/XInclude"; xpointer="element(/1/2)"/>
		<section>
			<title>Section 1</title>
			<para>Local to mybook</para>
		</section>
		<xi:include href="mychapter.xml" xmlns:xi="http://www.w3.org/2001/XInclude"; xpointer="element(/1/3)"/>
		<xi:include href="mychapter.xml" xmlns:xi="http://www.w3.org/2001/XInclude"; xpointer="section3"/>
	</chapter>
</book>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]