Selecting models with xi:include and concat()

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Selecting models with xi:include and concat()

Taras Bahnyuk
I need to select a model for xForm upon a parameter.
For that I use
<xsl:choose>
        <xsl:when>
                <xi:include .... />
        </xsl:when>
        <xsl:otherwise>
                <xi:include .... />
        </xsl:otherwice>
</xsl:choose>


Problem sits in <xi:include/>.

Line <xi:include
href="http://wsasd464:8080/exist/rest/db/TBAHtest/aaa.xml"/> works fine,
While <xi:include
href="concat('http://wsasd464:8080/exist/rest/db/','TBAHtest/aaa.xml'"/>
gives me finger in form of:

Exception Class org.orbeon.oxf.resources.ResourceNotFoundException
Message Cannot load
"/PCSentry_DEV/detail/concat('http://wsasd464:8080/exist/rest/db/','TBAH
test/aaa.xml')" with webapp loader

What am I doing wrong?

Thanks,
-Taras




--
The information contained in this communication and any attachments is confidential and may be privileged, and is for the sole use of the intended recipient(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify the sender immediately by replying to this message and destroy all copies of this message and any attachments. ASML is neither liable for the proper and complete transmission of the information contained in this communication, nor for any delay in its receipt.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Selecting models with xi:include and concat()

Stephen Bayliss
Your href attribute will just be seen as straight text I think, that's
why it's not doing the concat.

You'll (I think) need to use syntax more like the following to build
your xi:include elements, so that xsl processes the concat

<xi:include>
        <xsl:attribute name="href">
                <xsl:value-of select="concat('first bit', 'second
bit')"/>
        </xsl:attribute>
</xi:include>

Or something similar....  But you see the point I'm making hopefully

Steve

-----Original Message-----
From: Taras Bahnyuk [mailto:[hidden email]]
Sent: 14 August 2006 15:56
To: [hidden email]
Subject: [ops-users] Selecting models with xi:include and concat()

I need to select a model for xForm upon a parameter.
For that I use
<xsl:choose>
        <xsl:when>
                <xi:include .... />
        </xsl:when>
        <xsl:otherwise>
                <xi:include .... />
        </xsl:otherwice>
</xsl:choose>


Problem sits in <xi:include/>.

Line <xi:include
href="http://wsasd464:8080/exist/rest/db/TBAHtest/aaa.xml"/> works fine,
While <xi:include
href="concat('http://wsasd464:8080/exist/rest/db/','TBAHtest/aaa.xml'"/>
gives me finger in form of:

Exception Class org.orbeon.oxf.resources.ResourceNotFoundException
Message Cannot load
"/PCSentry_DEV/detail/concat('http://wsasd464:8080/exist/rest/db/','TBAH
test/aaa.xml')" with webapp loader

What am I doing wrong?

Thanks,
-Taras




--

The information contained in this communication and any attachments is
confidential and may be privileged, and is for the sole use of the
intended recipient(s). Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient,
please notify the sender immediately by replying to this message and
destroy all copies of this message and any attachments. ASML is neither
liable for the proper and complete transmission of the information
contained in this communication, nor for any delay in its receipt.





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Selecting models with xi:include and concat()

Florent Georges
In reply to this post by Taras Bahnyuk
Taras Bahnyuk wrote:

  Hi

> <xsl:choose>
>       <xsl:when>
>               <xi:include .... />
>       </xsl:when>
>       <xsl:otherwise>
>               <xi:include .... />
>       </xsl:otherwice>
> </xsl:choose>

  I guess you are in an XSLT processor.  The inclusion is
done before passing the script to the XSLT processor.  So
Orbeon try to load two documents (and one with a name
containing the caracters "concat(...") before fireing the
tranformation.

  One solution could be to mak first the transformation,
then post-process the result with the XInclude processor:

    <p:processor name="oxf:xslt">
      ...
        <xsl:transform
            xmlns:xi="http://www.w3.org/2001/XInclude"
            xmlns:xi_="http://www.w3.org/2001/XInclude/Alias"
            ...>
          <xsl:namespace-alias stylesheet-prefix="xi_"
                               result-prefix="xi"/>
            ...
            <xsl:choose>
              <xsl:when>
                <xi_:include .... />
              </xsl:when>
              <xsl:otherwise>
                <xi_:include .... />
              </xsl:otherwice>
            </xsl:choose>
            ...
        </xsl:transform>
      ...
      <p:output name="data" id="tranformed"/>
    </p:processor>

    <p:processor name="oxf:xinclude">
      <p:input  name="config" ref="transformed"/>
      <p:output name="data" ref="data"/>
    </p:processor>

  Not tested.

  Regards,

--drkm




















       
 p5.vert.ukl.yahoo.com uncompressed/chunked Mon Aug 14 15:13:41 GMT 2006
       
               
___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences.
http://fr.answers.yahoo.com 




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Selecting models with xi:include and concat()

Stephen Bayliss
In reply to this post by Taras Bahnyuk
Or as an alternative, you could skip xi:include altogether.

Use your xsl:choose to assign the name of the document to a variable, eg

<xsl:variable name="include-doc" select="http://wsasd464:8080/exist/rest/db/TBAHtest/aaa.xml"/>

Then use xsl:copy-of and the document() function to insert the document, eg

<xsl:copy-of select="document($include-doc)"/>

Not tested either... but in theory it should work...

Steve

-----Original Message-----
From: Florent Georges [mailto:[hidden email]]
Sent: 14 August 2006 16:33
To: [hidden email]
Subject: Re: [ops-users] Selecting models with xi:include and concat()

Taras Bahnyuk wrote:

  Hi

> <xsl:choose>
>       <xsl:when>
>               <xi:include .... />
>       </xsl:when>
>       <xsl:otherwise>
>               <xi:include .... />
>       </xsl:otherwice>
> </xsl:choose>

  I guess you are in an XSLT processor.  The inclusion is
done before passing the script to the XSLT processor.  So
Orbeon try to load two documents (and one with a name
containing the caracters "concat(...") before fireing the
tranformation.

  One solution could be to mak first the transformation,
then post-process the result with the XInclude processor:

    <p:processor name="oxf:xslt">
      ...
        <xsl:transform
            xmlns:xi="http://www.w3.org/2001/XInclude"
            xmlns:xi_="http://www.w3.org/2001/XInclude/Alias"
            ...>
          <xsl:namespace-alias stylesheet-prefix="xi_"
                               result-prefix="xi"/>
            ...
            <xsl:choose>
              <xsl:when>
                <xi_:include .... />
              </xsl:when>
              <xsl:otherwise>
                <xi_:include .... />
              </xsl:otherwice>
            </xsl:choose>
            ...
        </xsl:transform>
      ...
      <p:output name="data" id="tranformed"/>
    </p:processor>

    <p:processor name="oxf:xinclude">
      <p:input  name="config" ref="transformed"/>
      <p:output name="data" ref="data"/>
    </p:processor>

  Not tested.

  Regards,

--drkm




















       
 p5.vert.ukl.yahoo.com uncompressed/chunked Mon Aug 14 15:13:41 GMT 2006
       
               
___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences.
http://fr.answers.yahoo.com 






--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Selecting models with xi:include and concat()

Erik Bruchez
Administrator
In reply to this post by Taras Bahnyuk
Taras,

Your code below is incorrect. In XSLT, attribute values on literal
elements are also literal, so XPath expressions in them won't be
interpreted unless you use attribute value templates, that is you use
curly brackets around:

href="{concat('http://wsasd464:8080/exist/rest/db/','TBAHtest/aaa.xml'}"

Also, note that XInclude processing takes place *before* XSLT
processing. This may or may not be an issue in your case.

-Erik

Taras Bahnyuk wrote:

> I need to select a model for xForm upon a parameter.
> For that I use
> <xsl:choose>
> <xsl:when>
> <xi:include .... />
> </xsl:when>
> <xsl:otherwise>
> <xi:include .... />
> </xsl:otherwice>
> </xsl:choose>
>
>
> Problem sits in <xi:include/>.
>
> Line <xi:include
> href="http://wsasd464:8080/exist/rest/db/TBAHtest/aaa.xml"/> works fine,
> While <xi:include
> href="concat('http://wsasd464:8080/exist/rest/db/','TBAHtest/aaa.xml'"/>
> gives me finger in form of:
>
> Exception Class org.orbeon.oxf.resources.ResourceNotFoundException
> Message Cannot load
> "/PCSentry_DEV/detail/concat('http://wsasd464:8080/exist/rest/db/','TBAH
> test/aaa.xml')" with webapp loader
>
> What am I doing wrong?
>
> Thanks,
> -Taras
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws