Accessing instance data in XPL

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

Accessing instance data in XPL

stacyladnier
I am having trouble getting the text value of the input document to be included in the select portion of my copy-of statement. Everything I try results in a XML file output of <path>/a/b/c</path>, but what I need is a subset of the file.xml beginning with the path /a/b/c. Any help is appreciated.

Input document XML that is instance for XPL

<submission>
<path>/a/b/c</path>
</submission>

XPL

<p:param name="instance" type="input">

<p:processor name="oxf:xslt-2.0">
<p:input name="config">
   <xsl:stylesheet version="2.0" xmlns:xsl="http://www....">

   <xsl:template match="/">
       <xsl:copy-of select="NEED INSTANCE INFORMATION EVALUATING TO /a/b/c"/>
   </xsl:template>
   </xsl:stylesheet>
</p:input>
<p:input name="data" href="oxf:file.xml"/>
<p:output name="data" id="subset"/>
</p:processor>
Reply | Threaded
Open this post in threaded view
|

Re: Accessing instance data in XPL

Hank Ratzesberger
I believe what you want is a User-Defined input

<xsl:copy-of select="instance('my-inst')/a/b/c"/>

.....

<p:input name="my-inst" type="input"/>

Cheers,
Hank

On Sep 1, 2009, at 1:05 PM, stacyladnier wrote:

>
> I am having trouble getting the text value of the input document to be
> included in the select portion of my copy-of statement. Everything  
> I try
> results in a XML file output of <path>/a/b/c</path>, but what I  
> need is a
> subset of the file.xml beginning with the path /a/b/c. Any help is
> appreciated.
>
> Input document XML that is instance for XPL
>
> <submission>
> <path>/a/b/c</path>
> </submission>
>
> XPL
>
> <p:param name="instance" type="input">
>
> <p:processor name="oxf:xslt-2.0">
> <p:input name="config">
>    <xsl:stylesheet version="2.0" xmlns:xsl="http://www....">
>
>    <xsl:template match="/">
>        <xsl:copy-of select="NEED INSTANCE INFORMATION EVALUATING TO
> /a/b/c"/>
>    </xsl:template>
>    </xsl:stylesheet>
> </p:input>
> <p:input name="data" href="oxf:file.xml"/>
> <p:output name="data" id="subset"/>
> </p:processor>
> --
> View this message in context: http://www.nabble.com/Accessing- 
> instance-data-in-XPL-tp25244305p25244305.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.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
> OW2 mailing lists service home page: http://www.ow2.org/wws
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Accessing instance data in XPL

stacyladnier
In reply to this post by stacyladnier
This isn't a copy-of select within an XFORM. All of this is within an
XPL file.

The Xform submitted an instance that is the XML listed below.  From
within the xslt processor, I need to access that instance so I can
dynamically insert the string value of /a/b/c into the select attribute
of the copy-of tag.

I need the contents of the copy-of to be
<xsl:copy-of select="/a/b/c"/>

where /a/b/c is the text contained in the instance/submission/path element.

Using instance throws an error indicating instance() is an unknown
system function.

----- Original Message -----
From: Hank Ratzesberger <[hidden email]>
Date: Tuesday, September 1, 2009 3:21 pm
Subject: [ops-users] Re:  Accessing instance data in XPL

> I believe what you want is a User-Defined input
>
> <xsl:copy-of select="instance('my-inst')/a/b/c"/>
>
> .....
>
> <p:input name="my-inst" type="input"/>
>
> Cheers,
> Hank
>
> On Sep 1, 2009, at 1:05 PM, stacyladnier wrote:
>
> >
> > I am having trouble getting the text value of the input document
> to be
> > included in the select portion of my copy-of statement.
> Everything  
> > I try
> > results in a XML file output of <path>/a/b/c</path>, but what I  
> > need is a
> > subset of the file.xml beginning with the path /a/b/c. Any help is
> > appreciated.
> >
> > Input document XML that is instance for XPL
> >
> > <submission>
> > <path>/a/b/c</path>
> > </submission>
> >
> > XPL
> >
> > <p:param name="instance" type="input">
> >
> > <p:processor name="oxf:xslt-2.0">
> > <p:input name="config">
> >    <xsl:stylesheet version="2.0" xmlns:xsl="http://www....">
> >
> >    <xsl:template match="/">
> >        <xsl:copy-of select="NEED INSTANCE INFORMATION EVALUATING TO
> > /a/b/c"/>
> >    </xsl:template>
> >    </xsl:stylesheet>
> > </p:input>
> > <p:input name="data" href="oxf:file.xml"/>
> > <p:output name="data" id="subset"/>
> > </p:processor>
> > --
> > View this message in context: http://www.nabble.com/Accessing- 
> > instance-data-in-XPL-tp25244305p25244305.html
> > Sent from the ObjectWeb OPS - Users mailing list archive at  
> > Nabble.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
> > OW2 mailing lists service home page: http://www.ow2.org/wws
>
> Hank Ratzesberger
> NEES@UCSB
> Institute for Crustal Studies,
> University of California, Santa Barbara
> 805-893-8042
>
>
>
>
>
>


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Re: Re: Accessing instance data in XPL

Steve Bayliss
It sounds like you need two xslt processors in your xslt.

Your first processor will build an xslt for input into the second processor.
Ie it will get the contents of /submission/path, and use that to build the
"xsl:copy-of" statement within an xslt which will be the input to the second
processor.

I'm assuming that what you want is:

Your instance input:

<submission>
  <path>/a/b/c</path>
</submission>

First xslt output:

...
<xsl:copy-of select="/a/b/c"/>
...

Then your 2nd xslt will use this as the stylesheet input, and it will use
your "data" pipeline input as the data input.

You will have to mess around a bit with namespaces to get the first one
working properly - take a look at xsl:namespace-alias - there's an example
here - http://lenzconsulting.com/namespaces-in-xslt/#namespace-alias 

You probably want something like this in your first xslt processor (I
haven't tested this!):

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:out="http://www.example.org/dummy">

  <!-- using the prefix "out" here will result in the prefix "xsl" being
used in the output document -->
  <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>

  <xsl:template match="/">
    <out:stylesheet version="1.0">
      <out:template match="/">
        <out:copy-of>
          <xsl:attribute name="select">
            <xsl:value-of select="/submission/path"/>
          </xsl:attribute>
        </out:copy-of>
      </out:template>
    </out:stylesheet>
  </xsl:template>

</xsl:stylesheet>

Then your 2nd xslt processor will use this as the "config".

Steve


-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: 02 September 2009 01:29
To: [hidden email]
Subject: [ops-users] Re: Re: Accessing instance data in XPL


This isn't a copy-of select within an XFORM. All of this is within an
XPL file.

The Xform submitted an instance that is the XML listed below.  From
within the xslt processor, I need to access that instance so I can
dynamically insert the string value of /a/b/c into the select attribute
of the copy-of tag.

I need the contents of the copy-of to be
<xsl:copy-of select="/a/b/c"/>

where /a/b/c is the text contained in the instance/submission/path element.

Using instance throws an error indicating instance() is an unknown
system function.

----- Original Message -----
From: Hank Ratzesberger <[hidden email]>
Date: Tuesday, September 1, 2009 3:21 pm
Subject: [ops-users] Re:  Accessing instance data in XPL

> I believe what you want is a User-Defined input
>
> <xsl:copy-of select="instance('my-inst')/a/b/c"/>
>
> .....
>
> <p:input name="my-inst" type="input"/>
>
> Cheers,
> Hank
>
> On Sep 1, 2009, at 1:05 PM, stacyladnier wrote:
>
> >
> > I am having trouble getting the text value of the input document
> to be
> > included in the select portion of my copy-of statement.
> Everything  
> > I try
> > results in a XML file output of <path>/a/b/c</path>, but what I  
> > need is a
> > subset of the file.xml beginning with the path /a/b/c. Any help is
> > appreciated.
> >
> > Input document XML that is instance for XPL
> >
> > <submission>
> > <path>/a/b/c</path>
> > </submission>
> >
> > XPL
> >
> > <p:param name="instance" type="input">
> >
> > <p:processor name="oxf:xslt-2.0">
> > <p:input name="config">
> >    <xsl:stylesheet version="2.0" xmlns:xsl="http://www....">
> >
> >    <xsl:template match="/">
> >        <xsl:copy-of select="NEED INSTANCE INFORMATION EVALUATING TO
> > /a/b/c"/>
> >    </xsl:template>
> >    </xsl:stylesheet>
> > </p:input>
> > <p:input name="data" href="oxf:file.xml"/>
> > <p:output name="data" id="subset"/>
> > </p:processor>
> > --
> > View this message in context: http://www.nabble.com/Accessing- 
> > instance-data-in-XPL-tp25244305p25244305.html
> > Sent from the ObjectWeb OPS - Users mailing list archive at  
> > Nabble.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
> > OW2 mailing lists service home page: http://www.ow2.org/wws
>
> Hank Ratzesberger
> NEES@UCSB
> Institute for Crustal Studies,
> University of California, Santa Barbara
> 805-893-8042
>
>
>
>
>
>


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: RE: Re: Re: Accessing instance data in XPL

Steve Bayliss
Oops!  I meant:

It sounds like you need two xslt processors in your xpl.

-----Original Message-----
From: Steve Bayliss [mailto:[hidden email]]
Sent: 02 September 2009 09:24
To: [hidden email]
Subject: [ops-users] RE: Re: Re: Accessing instance data in XPL


It sounds like you need two xslt processors in your xslt.

Your first processor will build an xslt for input into the second processor.
Ie it will get the contents of /submission/path, and use that to build the
"xsl:copy-of" statement within an xslt which will be the input to the second
processor.

I'm assuming that what you want is:

Your instance input:

<submission>
  <path>/a/b/c</path>
</submission>

First xslt output:

...
<xsl:copy-of select="/a/b/c"/>
...

Then your 2nd xslt will use this as the stylesheet input, and it will use
your "data" pipeline input as the data input.

You will have to mess around a bit with namespaces to get the first one
working properly - take a look at xsl:namespace-alias - there's an example
here - http://lenzconsulting.com/namespaces-in-xslt/#namespace-alias 

You probably want something like this in your first xslt processor (I
haven't tested this!):

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:out="http://www.example.org/dummy">

  <!-- using the prefix "out" here will result in the prefix "xsl" being
used in the output document -->
  <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>

  <xsl:template match="/">
    <out:stylesheet version="1.0">
      <out:template match="/">
        <out:copy-of>
          <xsl:attribute name="select">
            <xsl:value-of select="/submission/path"/>
          </xsl:attribute>
        </out:copy-of>
      </out:template>
    </out:stylesheet>
  </xsl:template>

</xsl:stylesheet>

Then your 2nd xslt processor will use this as the "config".

Steve


-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: 02 September 2009 01:29
To: [hidden email]
Subject: [ops-users] Re: Re: Accessing instance data in XPL


This isn't a copy-of select within an XFORM. All of this is within an
XPL file.

The Xform submitted an instance that is the XML listed below.  From
within the xslt processor, I need to access that instance so I can
dynamically insert the string value of /a/b/c into the select attribute
of the copy-of tag.

I need the contents of the copy-of to be
<xsl:copy-of select="/a/b/c"/>

where /a/b/c is the text contained in the instance/submission/path element.

Using instance throws an error indicating instance() is an unknown
system function.

----- Original Message -----
From: Hank Ratzesberger <[hidden email]>
Date: Tuesday, September 1, 2009 3:21 pm
Subject: [ops-users] Re:  Accessing instance data in XPL

> I believe what you want is a User-Defined input
>
> <xsl:copy-of select="instance('my-inst')/a/b/c"/>
>
> .....
>
> <p:input name="my-inst" type="input"/>
>
> Cheers,
> Hank
>
> On Sep 1, 2009, at 1:05 PM, stacyladnier wrote:
>
> >
> > I am having trouble getting the text value of the input document
> to be
> > included in the select portion of my copy-of statement.
> Everything  
> > I try
> > results in a XML file output of <path>/a/b/c</path>, but what I  
> > need is a
> > subset of the file.xml beginning with the path /a/b/c. Any help is
> > appreciated.
> >
> > Input document XML that is instance for XPL
> >
> > <submission>
> > <path>/a/b/c</path>
> > </submission>
> >
> > XPL
> >
> > <p:param name="instance" type="input">
> >
> > <p:processor name="oxf:xslt-2.0">
> > <p:input name="config">
> >    <xsl:stylesheet version="2.0" xmlns:xsl="http://www....">
> >
> >    <xsl:template match="/">
> >        <xsl:copy-of select="NEED INSTANCE INFORMATION EVALUATING TO
> > /a/b/c"/>
> >    </xsl:template>
> >    </xsl:stylesheet>
> > </p:input>
> > <p:input name="data" href="oxf:file.xml"/>
> > <p:output name="data" id="subset"/>
> > </p:processor>
> > --
> > View this message in context: http://www.nabble.com/Accessing- 
> > instance-data-in-XPL-tp25244305p25244305.html
> > Sent from the ObjectWeb OPS - Users mailing list archive at  
> > Nabble.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
> > OW2 mailing lists service home page: http://www.ow2.org/wws
>
> Hank Ratzesberger
> NEES@UCSB
> Institute for Crustal Studies,
> University of California, Santa Barbara
> 805-893-8042
>
>
>
>
>
>



--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: RE: Re: Re: Accessing instance data in XPL

stacyladnier
In reply to this post by stacyladnier
It worked. Thank you Steve!

----- Original Message -----
From: Steve Bayliss <[hidden email]>
Date: Wednesday, September 2, 2009 3:23 am
Subject: [ops-users] RE: Re: Re:  Accessing instance data in XPL

> It sounds like you need two xslt processors in your xslt.
>
> Your first processor will build an xslt for input into the second
> processor.Ie it will get the contents of /submission/path, and use
> that to build the
> "xsl:copy-of" statement within an xslt which will be the input to
> the second
> processor.
>
> I'm assuming that what you want is:
>
> Your instance input:
>
> <submission>
>  <path>/a/b/c</path>
> </submission>
>
> First xslt output:
>
> ...
> <xsl:copy-of select="/a/b/c"/>
> ...
>
> Then your 2nd xslt will use this as the stylesheet input, and it
> will use
> your "data" pipeline input as the data input.
>
> You will have to mess around a bit with namespaces to get the first
> oneworking properly - take a look at xsl:namespace-alias - there's
> an example
> here - http://lenzconsulting.com/namespaces-in-xslt/#namespace-
> alias
>
> You probably want something like this in your first xslt processor (I
> haven't tested this!):
>
> <xsl:stylesheet version="1.0"
>  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>  xmlns:out="http://www.example.org/dummy">
>
>  <!-- using the prefix "out" here will result in the prefix "xsl"
> beingused in the output document -->
>  <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
>
>  <xsl:template match="/">
>    <out:stylesheet version="1.0">
>      <out:template match="/">
>        <out:copy-of>
>          <xsl:attribute name="select">
>            <xsl:value-of select="/submission/path"/>
>          </xsl:attribute>
>        </out:copy-of>
>      </out:template>
>    </out:stylesheet>
>  </xsl:template>
>
> </xsl:stylesheet>
>
> Then your 2nd xslt processor will use this as the "config".
>
> Steve
>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: 02 September 2009 01:29
> To: [hidden email]
> Subject: [ops-users] Re: Re: Accessing instance data in XPL
>
>
> This isn't a copy-of select within an XFORM. All of this is within an
> XPL file.
>
> The Xform submitted an instance that is the XML listed below.  From
> within the xslt processor, I need to access that instance so I can
> dynamically insert the string value of /a/b/c into the select
> attributeof the copy-of tag.
>
> I need the contents of the copy-of to be
> <xsl:copy-of select="/a/b/c"/>
>
> where /a/b/c is the text contained in the instance/submission/path
> element.
> Using instance throws an error indicating instance() is an unknown
> system function.
>
> ----- Original Message -----
> From: Hank Ratzesberger <[hidden email]>
> Date: Tuesday, September 1, 2009 3:21 pm
> Subject: [ops-users] Re:  Accessing instance data in XPL
>
> > I believe what you want is a User-Defined input
> >
> > <xsl:copy-of select="instance('my-inst')/a/b/c"/>
> >
> > .....
> >
> > <p:input name="my-inst" type="input"/>
> >
> > Cheers,
> > Hank
> >
> > On Sep 1, 2009, at 1:05 PM, stacyladnier wrote:
> >
> > >
> > > I am having trouble getting the text value of the input
> document
> > to be
> > > included in the select portion of my copy-of statement.
> > Everything  
> > > I try
> > > results in a XML file output of <path>/a/b/c</path>, but what I
>
> > > need is a
> > > subset of the file.xml beginning with the path /a/b/c. Any help is
> > > appreciated.
> > >
> > > Input document XML that is instance for XPL
> > >
> > > <submission>
> > > <path>/a/b/c</path>
> > > </submission>
> > >
> > > XPL
> > >
> > > <p:param name="instance" type="input">
> > >
> > > <p:processor name="oxf:xslt-2.0">
> > > <p:input name="config">
> > >    <xsl:stylesheet version="2.0" xmlns:xsl="http://www....">
> > >
> > >    <xsl:template match="/">
> > >        <xsl:copy-of select="NEED INSTANCE INFORMATION
> EVALUATING TO
> > > /a/b/c"/>
> > >    </xsl:template>
> > >    </xsl:stylesheet>
> > > </p:input>
> > > <p:input name="data" href="oxf:file.xml"/>
> > > <p:output name="data" id="subset"/>
> > > </p:processor>
> > > --
> > > View this message in context: http://www.nabble.com/Accessing- 
> > > instance-data-in-XPL-tp25244305p25244305.html
> > > Sent from the ObjectWeb OPS - Users mailing list archive at  
> > > Nabble.com.
> > >
> > >
> > > --
> > > You receive this message as a subscriber of the ops-
> [hidden email]
> >
> > > mailing list.
> > > To unsubscribe: mailto:[hidden email]
> > > For general help: mailto:[hidden email]?subject=help
> > > OW2 mailing lists service home page: http://www.ow2.org/wws
> >
> > Hank Ratzesberger
> > NEES@UCSB
> > Institute for Crustal Studies,
> > University of California, Santa Barbara
> > 805-893-8042
> >
> >
> >
> >
> >
> >
>
>


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws