This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Calling java application during a parsing


David Delgranche wrote:
> I have a question without knowing if it's an XSLT question or more a
> xalan question. I hope someone would help me.
> I have two XML schemas linking with an <xsl:include
> href="secondSchema.xsd"/> in the first one. My question is:

xsl:include is for combining stylesheets.

> 	Is it possible in an xslt stylesheet to invoque a java parser command
> when finding the xsl:include tag?

In some situations you can invoke java methods using extension functions,
but xsl:include does not allow functions as arguments, including extension
functions.

As Eric mentioned, it sounds like you want to use the document() function
to access the root nodes of 2 different XML documents.

<!-- use variables for convenience -->
<xsl:variable name="schema1Root" select="document('firstschema.xsd')"/>
<xsl:variable name="schema2Root" select="document('firstschema.xsd')"/>
<xsl:variable name="schema1Param" select="$schema1Root/path/to/parameter"/>

<!-- nodes with string values matching the parameter node's string value -->
<xsl:for-each select="$schema2Root/path/to/nodes[.=$schema1Param]">
 ...
</xsl:for-each>

<!-- element nodes with names matching the parameter node's string value -->
<xsl:for-each select="$schema2Root/path/to/nodes[name()=$schema1Param]">
 ...
</xsl:for-each>

...just as an example.

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at            My XML/XSL resources: 
webb.net in Denver, Colorado, USA              http://skew.org/xml/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]