How to access model data in xsl view

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

How to access model data in xsl view

Shaw, Richard A
How to access model data in xsl view

I have a page which is using xsl to render the data and I can't figure out how to access the model data from the xsl:value-of - can anybody help, my page is shown below -

<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:ui="urn:ui"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xsl:version="2.0">
     
    <xhtml:head>
    <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
        <xforms:instance id="my-data">
            <root>
                <data1>1</data1>
                <data2>2</data2>
            </root>
        </xforms:instance>
    </xforms:model>
    </xhtml:head>
    <xhtml:body>
                Data = <xsl:value-of select="document('#my-data')/root/data1"/>
    </xhtml:body>
</xhtml:html>

The reason I am doing this is that my page has a table with a summary of 5 items in my input data. When the user selects one of the rows I replace my-data with the details of one of the selected items (it's a bit inefficient because my XPL just copied details from the instance in the page to my-data, but I need some way of refreshing the xsl view).

I suppose I could have converted my data to html in the xpl and then just used an xforms:output to print my ready converted detail view, but I want to have triggers in the details view, I wasn't sure if they would work if they were produced elsewhere.

I'm sure I haven't described myself very well. So I have attached my test page and data. You need the following in the page-flow to use it -

    <page id='test-journey2' path-info="/ras/test/test-journey2" default-submission="test-journey-result.xml" view="test-journey2.xhtml"/>

    <page id='test-journey2-select-page' path-info="/ras/test/refresh/test-journey2" view="select-journey.xpl"/>

Essentially I want to allow the user to select a row in the table and see the details of that journey, and then I want to add trigger buttons to the journey details to go to a bigger map display (the images are maps when the correct URL is used).

<<test-journey-result.xml>> <<test-journey2.xhtml>> <<select-journey.xpl>>

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Atkins Transport Systems
Woodcote Grove
Ashley Road
Epsom
KT18 5BW

Direct Dial.: +44 (0) 1372 756407
Switchboard:  +44 (0) 1372 726140
Fax:          +44 (0) 1372 740055
www.atkinsglobal.com/transportsystems





This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.


test-journey-result.xml (42K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: How to access model data in xsl view

Ryan Puddephatt
How to access model data in xsl view

Richard,

            /root/data1 will work for you

 

Ryan

 

Ryan Puddephatt

Software Engineer

TFX Group - IT UK

1 Michaelson Square

Livingston

West Lothian

Scotand

EH54 7DP

 

* [hidden email]

( 01506 407 110

7  01506 407 108

 


From: Shaw, Richard A [mailto:[hidden email]]
Sent: 22 April 2006 12:58
To: [hidden email]
Subject: [ops-users] How to access model data in xsl view

 

I have a page which is using xsl to render the data and I can't figure out how to access the model data from the xsl:value-of - can anybody help, my page is shown below -

<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:ui="urn:ui"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xsl:version="2.0">
     
    <xhtml:head>
    <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
        <xforms:instance id="my-data">
            <root>
                <data1>1</data1>
                <data2>2</data2>
            </root>
        </xforms:instance>
    </xforms:model>
    </xhtml:head>
    <xhtml:body>
                Data = <xsl:value-of select="document('#my-data')/root/data1"/>
    </xhtml:body>
</xhtml:html>

The reason I am doing this is that my page has a table with a summary of 5 items in my input data. When the user selects one of the rows I replace my-data with the details of one of the selected items (it's a bit inefficient because my XPL just copied details from the instance in the page to my-data, but I need some way of refreshing the xsl view).

I suppose I could have converted my data to html in the xpl and then just used an xforms:output to print my ready converted detail view, but I want to have triggers in the details view, I wasn't sure if they would work if they were produced elsewhere.

I'm sure I haven't described myself very well. So I have attached my test page and data. You need the following in the page-flow to use it -

    <page id='test-journey2' path-info="/ras/test/test-journey2" default-submission="test-journey-result.xml" view="test-journey2.xhtml"/>

    <page id='test-journey2-select-page' path-info="/ras/test/refresh/test-journey2" view="select-journey.xpl"/>

Essentially I want to allow the user to select a row in the table and see the details of that journey, and then I want to add trigger buttons to the journey details to go to a bigger map display (the images are maps when the correct URL is used).

<<test-journey-result.xml>> <<test-journey2.xhtml>> <<select-journey.xpl>>

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Atkins Transport Systems
Woodcote Grove
Ashley Road

Epsom
KT18 5BW

Direct Dial.: +44 (0) 1372 756407
Switchboard:  +44 (0) 1372 726140
Fax:          +44 (0) 1372 740055
<a href="file:///\\www.atkinsglobal.com\transportsystems">www.atkinsglobal.com/transportsystems




This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.



--
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: How to access model data in xsl view

Shaw, Richard A
In reply to this post by Shaw, Richard A
How to access model data in xsl view
That works in an xforms:output but it doesn't seem to work for xsl:value-of.
 

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Atkins Transport Systems
Woodcote Grove
Ashley Road
Epsom
KT18 5BW

Direct Dial.: +44 (0) 1372 756407
Switchboard:  +44 (0) 1372 726140
Fax:          +44 (0) 1372 740055
www.atkinsglobal.com/transportsystems


 


From: Ryan Puddephatt [mailto:[hidden email]]
Sent: 23 April 2006 17:44
To: [hidden email]
Subject: RE: [ops-users] How to access model data in xsl view

Richard,

            /root/data1 will work for you

Ryan

Ryan Puddephatt

Software Engineer

TFX Group - IT UK

1 Michaelson Square

Livingston

West Lothian

Scotand

EH54 7DP

* [hidden email]

( 01506 407 110

7  01506 407 108


From: Shaw, Richard A [mailto:[hidden email]]
Sent: 22 April 2006 12:58
To: [hidden email]
Subject: [ops-users] How to access model data in xsl view

I have a page which is using xsl to render the data and I can't figure out how to access the model data from the xsl:value-of - can anybody help, my page is shown below -

<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:ui="urn:ui"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xsl:version="2.0">
     
    <xhtml:head>
    <xforms:model xmlns:xforms="http://www.w3.org/2002/xforms">
        <xforms:instance id="my-data">
            <root>
                <data1>1</data1>
                <data2>2</data2>
            </root>
        </xforms:instance>
    </xforms:model>
    </xhtml:head>
    <xhtml:body>
                Data = <xsl:value-of select="document('#my-data')/root/data1"/>
    </xhtml:body>
</xhtml:html>

The reason I am doing this is that my page has a table with a summary of 5 items in my input data. When the user selects one of the rows I replace my-data with the details of one of the selected items (it's a bit inefficient because my XPL just copied details from the instance in the page to my-data, but I need some way of refreshing the xsl view).

I suppose I could have converted my data to html in the xpl and then just used an xforms:output to print my ready converted detail view, but I want to have triggers in the details view, I wasn't sure if they would work if they were produced elsewhere.

I'm sure I haven't described myself very well. So I have attached my test page and data. You need the following in the page-flow to use it -

    <page id='test-journey2' path-info="/ras/test/test-journey2" default-submission="test-journey-result.xml" view="test-journey2.xhtml"/>

    <page id='test-journey2-select-page' path-info="/ras/test/refresh/test-journey2" view="select-journey.xpl"/>

Essentially I want to allow the user to select a row in the table and see the details of that journey, and then I want to add trigger buttons to the journey details to go to a bigger map display (the images are maps when the correct URL is used).

<<test-journey-result.xml>> <<test-journey2.xhtml>> <<select-journey.xpl>>

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Atkins Transport Systems
Woodcote Grove
Ashley Road

Epsom
KT18 5BW

Direct Dial.: +44 (0) 1372 756407
Switchboard:  +44 (0) 1372 726140
Fax:          +44 (0) 1372 740055
<A href="file:///\\www.atkinsglobal.com\transportsystems">www.atkinsglobal.com/transportsystems




This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.



This message has been scanned for viruses by MailControl



--
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