[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Selectively applying Identity transform to multipl

Subject: Re: Selectively applying Identity transform to multiple inputs (Multiplexer Style Sheet)
From: "Farrukh S. Najmi" <farrukh@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 05 Jan 2007 17:27:36 -0500
michael iden
Thank you all for the terrific help and support. I have it working
nicely now. This is a really solid community.

I am using the default xalan XSLT 1.0 engine that comes with Sun's JDK 5
in my open source project <http://ebxmlrr.sourceforge.net>.
I guess its time to move to an open source XSLT 2.0 implementation that
will work with the TrAX API in JDK 5. I am assuming Saxon
is the best to fit that description (and that Micheal approves of this
choice ;-) )

As background, I am working to add a "Role Based Content Filtering"
feature to our Registry / Repository to provide element and
attribute level access control to a repository of XML documents based
upon roles and other credentials associated with the subject
attempting to retrieve an XML document.

Thanks again for all the help.

Michael Kay wrote:
> Something like this:
>
> <xsl:template match="/">
>   <xsl:choose>
>     <xsl:when test="$input2 != ''">
>       <xsl:apply-templates select="document($input2)/child::node()"/>
>     </xsl:when>
>     <xsl:otherwise>
>       <xsl:apply-templates select="./child::node()"/>
>     </xsl:otherwise>
>   </xsl:choose>
> </xsl:template>
>
> Or replace the xsl:apply-templates by xsl:copy-of if it really is a pure
> copy.
>
> In 2.0 you can do
>
> <xsl:template match="/">
>   <xsl:apply-templates 
>     select="(if ($input2='') then document($input2) else .)/child::node()"/>
> </xsl:template>
>
> Michael Kay
> http://www.saxonica.com/
>
>
>
>   
>> -----Original Message-----
>> From: Farrukh S. Najmi [mailto:farrukh@xxxxxxxxxxxxxxxxxxxxx] 
>> Sent: 05 January 2007 20:20
>> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>> Subject:  Selectively applying Identity transform to 
>> multiple inputs (Multiplexer Style Sheet)
>>
>>
>> Dear colleagues,
>>
>> I have a newbie question.
>>
>> In my XSLT, in addition to my main input, I am reading a 
>> second input in my XSLT using the document() function.
>> The second input's URL is specified via an <xsl:param>:
>>
>>     <xsl:param name="input2" select="''"></xsl:param>
>>
>> I need to produce output tree that is either the identity 
>> transform of the main input or the second input depending 
>> upon whether the parameter
>> $input2 is null/empty or not. If it is null/empty then the 
>> main input should be copied to output tree. If it is not 
>> null/empty then the second input should be copied to output tree.
>>
>> I have been unable to do this correctly after much trying.
>>
>> Can someone provide some guidance on how to accomplish this 
>> seemingly simple task?
>>
>> Thanks for your help.
>>
>> --
>> Regards,
>> Farrukh
>>
>> Web: http://www.wellfleetsoftware.com
>
>   


-- 
Regards,
Farrukh

Web: http://www.wellfleetsoftware.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.