Thanx for the quick reply. (//DIO)[1] fixed it.

Mit den besten Gruessen/Best regards,

Wolfgang Mantel

I BS PG4 SWP
Continental Automotive GmbH,
Siemensstrasse 12,
93055 Regensburg, Germany
Telefon/Phone: +49 941 790-3215
Telefax: +49 941 79013-3215
E-Mail: Wolfgang.Mantel@continental-corporation.com
http://www.continental-corporation.com
-------------------------------------------------------------------------
Continental Automotive GmbH, Siemensstr. 12, 93055 Regensburg, Germany
Geschäftsführer/Managing Directors: Helmut Matschi, Gérard Cordonnier, Harald Stuhlmann
Sitz der Gesellschaft/Registered office: Hannover
Registergericht/Commercial registry: Hannover, HRB 59424, USt-Id. Nr. DE814950663
__________________________________________
Proprietary and confidential. Distribution only by express authority of Continental AG or its
subsidiaries.
Proprietary and confidential. Distribution only by express authority of Continental AG or its subsidiaries.




Von:        Michael Kay <mike@saxonica.com>
An:        Mailing list for the SAXON XSLT and XQuery processor <saxon-help@lists.sourceforge.net>
Datum:        09.08.2013 20:58
Betreff:        Re: [saxon] xpath don't work across xi:include




It seems to be handling the XInclude without any problems, since data from the included file is in the result.

I suspect that when you write //DIO[1] you should have written (//DIO)[1]. The former selects every DIO element that is the first child of its parent; the latter selects the first DIO element in the document.

xsl:value-of changed between 1.0 and 2.0: when you select a node-set, 1.0 only outputs the first item in the node-set and ignores the others, whereas 2.0 outputs them all.

Michael Kay
Saxonica

On 9 Aug 2013, at 17:38, Wolfgang.Mantel@continental-corporation.com wrote:

Hello,

I am trying to get an xpath search running across xi:include. The search is in the top file  prj.xmlprj together with the search string //DIO[1]/@name, the node DIO is whowever in the included file.

I run this batch


set JAVA=d:/ts_mirr/xml/jre6u45/bin/java.exe -Duser.language=en

set XALANPATH=-Djava.endorsed.dirs="d:/ts_mirr/xml/xerces2.6.2;d:/ts_mirr/xml/saxon-b"

set XINCLUDE=-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration

set XALAN=net.sf.saxon.Transform

%JAVA%  %XALANPATH% %XINCLUDE% %XALAN% -s:prj.xmlprj -xsl:io.xsl


prj.xmlprj:

<xi:project xmlns:xi="
http://www.w3.org/2003/XInclude"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.w3.org/2003/XInclude sparc_project.xsd">
       <Stack Name="Io">

               <FileEntry XsdFilePath="C:\Users\uid01139\Documents\SametimeFileTransfers">

                       <xi:include href="io.xml" parse="xml" xml:base="C:/Users/uid01139/Documents/SametimeFileTransfers/"/>

               </FileEntry>

       </Stack>

</xi:project>



io.xsl:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"  xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
xmlns:fo="
http://www.w3.org/1999/XSL/Format">

<xsl:template match="/">


1 ) Display all DIO

<xsl:for-each select="//IO/*/DIO">

DIO <xsl:value-of select="@name"/>: <xsl:value-of select="@value"/>,

</xsl:for-each>


2 ) Display all first DIO only !!!

First only : <xsl:value-of select="//DIO[1]/@name"/>


3 ) Display all DIO having value = true

<xsl:for-each select="//IO/*/DIO[@value='true']">

DIO <xsl:value-of select="@name"/>: <xsl:value-of select="@value"/>,

</xsl:for-each>



</xsl:template>


</xsl:stylesheet>





and io.xml is just a simple thing like this

<?xml version="1.0" encoding="UTF-8"?>

<IO>

       <PORT1>

               <DIO name="a0" value="true"/>

               <DIO name="a1" value="false"/>

               <DIO name="a2" value="true"/>

       </PORT1>

       <PORT2>

               <DIO name="b0" value="false"/>

               <DIO name="b1" value="true"/>

       </PORT2>

       <PORT3>

               <DIO name="c0" value="true"/>

       </PORT3>

       <BlackList>

               <Signal name="a0"></Signal>

               <Signal name="c0"></Signal>

       </BlackList>                

</IO>


when I change the stylesheet version "1.0"  to "2.0", the xpath does not work anymore

result for version 1.0 : First only : a0

result for version 2.0 :First only : a0 b0 c0


I really want to use the features of version 2. What am I doing wrong?



Mit den besten Gruessen/Best regards,

Wolfgang Mantel

I BS PG4 SWP
Continental Automotive GmbH,
Siemensstrasse 12,
93055 Regensburg, Germany
Telefon/Phone: +49 941 790-3215
Telefax: +49 941 79013-3215
E-Mail:
Wolfgang.Mantel@continental-corporation.com
http://www.continental-corporation.com
-------------------------------------------------------------------------
Continental Automotive GmbH, Siemensstr. 12, 93055 Regensburg, Germany
Geschäftsführer/Managing Directors: Helmut Matschi, Gérard Cordonnier, Harald Stuhlmann
Sitz der Gesellschaft/Registered office: Hannover
Registergericht/Commercial registry: Hannover, HRB 59424, USt-Id. Nr. DE814950663
__________________________________________
Proprietary and confidential. Distribution only by express authority of Continental AG or its
subsidiaries.
Proprietary and confidential. Distribution only by express authority of Continental AG or its subsidiaries.
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.

http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk_______________________________________________
saxon-help mailing list archived at
http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help