Resource URL
|
Threaded
|
OPS SOAP RETURN VALUES
|
I am a little confused about the return values from the model.xpl in the
Google SOAP sample I posted.
In the view.xsl, there is a stmt that prints out the response from the
SOAP call like this:
<xsl:if test="doc('input:instance')/query != ''">
<pre><xsl:value-of select="/return"/></pre>
</xsl:if>
Without being able to see I return, i cant figure out the XPath needed
to get to the elements of the response that I am interestd in for
formatting, namely
the snippet, URL, etc from the google response.
What would you use as an XPath?
Also does anyone think a WSDL to XPL generator would be a good idea for OPS?
Rich
--
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
|
|
Richard,
if you output your data in your xpl as instance data:
<p:param name="instance" type="output" />
you need to reference this data in the view like this:
<xforms:instance id="user-instance">
<xsl:copy-of select="document('input:instance')"/>
</xforms:instance>
if you output your data in your xpl as data:
<p:param name="data" type="output" />
you need to reference this data in the view like this:
<xforms:instance id="user-instance">
<xsl:copy-of select="/"/>
</xforms:instance>
Also, you can add the attribute 'debug="somename"' to any pipeline
component's <input> or <output> elements to print the content to the
log.
Hope that helps.
Henrik
On 9/2/06, Richard Braman < [hidden email]> wrote:
> I am a little confused about the return values from the model.xpl in the
> Google SOAP sample I posted.
>
> In the view.xsl, there is a stmt that prints out the response from the
> SOAP call like this:
>
> <xsl:if test="doc('input:instance')/query != ''">
>
> <pre><xsl:value-of select="/return"/></pre>
>
> </xsl:if>
>
>
> Without being able to see I return, i cant figure out the XPath needed
> to get to the elements of the response that I am interestd in for
> formatting, namely
> the snippet, URL, etc from the google response.
>
> What would you use as an XPath?
>
> Also does anyone think a WSDL to XPL generator would be a good idea for OPS?
>
> Rich
>
>
>
>
>
>
> --
> 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>
>
>
--
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
|
|
I'd recommend something along the same lines -- either use the debug attribute so you can see the SOAP response document, so you can figure out the XPath from that, or have a test page-flow entry (possibly with a test pipeline as well) so you can dump the response straight to the browser, or use SoapUI to test the call and view the response.
And yes, some kind of tool support for WSDL would be great!
Steve
-----Original Message-----
From: Henrik Pettersen [mailto: [hidden email]]
Sent: Sun 03-Sep-06 6:47 PM
To: [hidden email]
Subject: Re: [ops-users] OPS SOAP RETURN VALUES
Richard,
if you output your data in your xpl as instance data:
<p:param name="instance" type="output" />
you need to reference this data in the view like this:
<xforms:instance id="user-instance">
<xsl:copy-of select="document('input:instance')"/>
</xforms:instance>
if you output your data in your xpl as data:
<p:param name="data" type="output" />
you need to reference this data in the view like this:
<xforms:instance id="user-instance">
<xsl:copy-of select="/"/>
</xforms:instance>
Also, you can add the attribute 'debug="somename"' to any pipeline
component's <input> or <output> elements to print the content to the
log.
Hope that helps.
Henrik
On 9/2/06, Richard Braman < [hidden email]> wrote:
> I am a little confused about the return values from the model.xpl in the
> Google SOAP sample I posted.
>
> In the view.xsl, there is a stmt that prints out the response from the
> SOAP call like this:
>
> <xsl:if test="doc('input:instance')/query != ''">
>
> <pre><xsl:value-of select="/return"/></pre>
>
> </xsl:if>
>
>
> Without being able to see I return, i cant figure out the XPath needed
> to get to the elements of the response that I am interestd in for
> formatting, namely
> the snippet, URL, etc from the google response.
>
> What would you use as an XPath?
>
> Also does anyone think a WSDL to XPL generator would be a good idea for OPS?
>
> Rich
>
>
>
>
>
>
> --
> 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>
>
>
--
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
|
|
Henrik , Stephen
Thanks for the input.
here is the code in view.xsl to print the results in google like format,
but there are a couple of problems I am not sure how to handle in xslt.
First the <title>, <snippet> , and <URL> xml elements complete with type
information are actually printing out in the html instead of being
filtered out. this is causing the problem of the title not being
displayed as title is a html tag. Secondly, the google results have some
bold and break tags that are being encoded incorrectly and not rendering
right.
<xsl:for-each select="/return/resultElements/item">
<p>
<xsl:copy-of select="title"/>
<br/>
<xsl:copy-of select="snippet"/>
<br/>
<xsl:variable name="URL"
select="URL"></xsl:variable>
<b>
<a href="{$URL}"><xsl:copy-of
select="URL"></xsl:copy-of></a>
</b>
<br/>
</p>
</xsl:for-each>
here is html this returns:
<p>
<title xsi_1:type="xsd:string"><b>SEO</b>
Home</title><br><snippet xsi_1:type="xsd:string">Mentor an
<b>SEO</b> Scholar! 07 Aug 06. Click here to learn more.
<b>...</b> 55 Exchange Place<br> New York, NY 10005 (212)
979-2040 info@<b>seo</b>-usa.org <b>...</b>
</snippet><br><b><a href=" http://www.seo-ny.org/">
<URL
xsi_1:type="xsd:string"> http://www.seo-ny.org/</URL></a></b><br></p>
<p>
> Richard,
>
> if you output your data in your xpl as instance data:
> <p:param name="instance" type="output" />
>
> you need to reference this data in the view like this:
> <xforms:instance id="user-instance">
> <xsl:copy-of select="document('input:instance')"/>
> </xforms:instance>
>
> if you output your data in your xpl as data:
> <p:param name="data" type="output" />
>
> you need to reference this data in the view like this:
> <xforms:instance id="user-instance">
> <xsl:copy-of select="/"/>
> </xforms:instance>
>
> Also, you can add the attribute 'debug="somename"' to any pipeline
> component's <input> or <output> elements to print the content to the
> log.
>
> Hope that helps.
>
> Henrik
>
> On 9/2/06, Richard Braman < [hidden email]> wrote:
>> I am a little confused about the return values from the model.xpl in the
>> Google SOAP sample I posted.
>>
>> In the view.xsl, there is a stmt that prints out the response from the
>> SOAP call like this:
>>
>> <xsl:if test="doc('input:instance')/query != ''">
>>
>> <pre><xsl:value-of select="/return"/></pre>
>>
>> </xsl:if>
>>
>>
>> Without being able to see I return, i cant figure out the XPath needed
>> to get to the elements of the response that I am interestd in for
>> formatting, namely
>> the snippet, URL, etc from the google response.
>>
>> What would you use as an XPath?
>>
>> Also does anyone think a WSDL to XPL generator would be a good idea
>> for OPS?
>>
>> Rich
>>
>>
>>
>>
>>
>>
>> --
>> 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>>
>>
>>
>
> ------------------------------------------------------------------------
>
>
> --
> 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>
--
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
|
|
Richard,
have a look at these:
fn:escape-uri(stringURI,esc-res):
http://www.w3schools.com/xpath/xpath_functions.asphttp://mail-archive.objectweb.org/ops-users/2006-08/msg00629.htmlHope that helps.
Henrik
On 9/4/06, Richard Braman < [hidden email]> wrote:
> Henrik , Stephen
> Thanks for the input.
> here is the code in view.xsl to print the results in google like format,
> but there are a couple of problems I am not sure how to handle in xslt.
> First the <title>, <snippet> , and <URL> xml elements complete with type
> information are actually printing out in the html instead of being
> filtered out. this is causing the problem of the title not being
> displayed as title is a html tag. Secondly, the google results have some
> bold and break tags that are being encoded incorrectly and not rendering
> right.
>
> <xsl:for-each select="/return/resultElements/item">
> <p>
> <xsl:copy-of select="title"/>
> <br/>
> <xsl:copy-of select="snippet"/>
> <br/>
> <xsl:variable name="URL"
> select="URL"></xsl:variable>
> <b>
> <a href="{$URL}"><xsl:copy-of
> select="URL"></xsl:copy-of></a>
> </b>
> <br/>
> </p>
> </xsl:for-each>
>
> here is html this returns:
> <p>
> <title xsi_1:type="xsd:string"><b>SEO</b>
> Home</title><br><snippet xsi_1:type="xsd:string">Mentor an
> <b>SEO</b> Scholar! 07 Aug 06. Click here to learn more.
> <b>...</b> 55 Exchange Place<br> New York, NY 10005 (212)
> 979-2040 info@<b>seo</b>-usa.org <b>...</b>
> </snippet><br><b><a href=" http://www.seo-ny.org/">
> <URL
> xsi_1:type="xsd:string"> http://www.seo-ny.org/</URL></a></b><br></p>
> <p>
>
>
> > Richard,
> >
> > if you output your data in your xpl as instance data:
> > <p:param name="instance" type="output" />
> >
> > you need to reference this data in the view like this:
> > <xforms:instance id="user-instance">
> > <xsl:copy-of select="document('input:instance')"/>
> > </xforms:instance>
> >
> > if you output your data in your xpl as data:
> > <p:param name="data" type="output" />
> >
> > you need to reference this data in the view like this:
> > <xforms:instance id="user-instance">
> > <xsl:copy-of select="/"/>
> > </xforms:instance>
> >
> > Also, you can add the attribute 'debug="somename"' to any pipeline
> > component's <input> or <output> elements to print the content to the
> > log.
> >
> > Hope that helps.
> >
> > Henrik
> >
> > On 9/2/06, Richard Braman < [hidden email]> wrote:
> >> I am a little confused about the return values from the model.xpl in the
> >> Google SOAP sample I posted.
> >>
> >> In the view.xsl, there is a stmt that prints out the response from the
> >> SOAP call like this:
> >>
> >> <xsl:if test="doc('input:instance')/query != ''">
> >>
> >> <pre><xsl:value-of select="/return"/></pre>
> >>
> >> </xsl:if>
> >>
> >>
> >> Without being able to see I return, i cant figure out the XPath needed
> >> to get to the elements of the response that I am interestd in for
> >> formatting, namely
> >> the snippet, URL, etc from the google response.
> >>
> >> What would you use as an XPath?
> >>
> >> Also does anyone think a WSDL to XPL generator would be a good idea
> >> for OPS?
> >>
> >> Rich
> >>
> >>
> >>
> >>
> >>
> >>
> >> --
> >> 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> >>
> >>
> >>
> >
> > ------------------------------------------------------------------------
> >
> >
> > --
> > 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> >
>
>
>
>
>
>
> --
> 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>
>
>
--
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
|
|
Hi Henrick,
I am not sure how the escare-uri would help, these are html encodings.
I looked at
saxon:serialize, but I am not sure what to put in the parameters. I tried
<xsl:copy-of select="saxon:serialize(snippet,'')"/>
but that printed out all sorts of additional xml. like this:
<?xml version="1.0" encoding="UTF-8"?><snippet
xmlns:ns3=" http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xmlns:f=" http://orbeon.org/oxf/xml/formatting"
xmlns:xhtml=" http://www.w3.org/1999/xhtml"
xmlns:oxf=" http://www.orbeon.com/oxf/processors"
xmlns:delegation=" http://orbeon.org/oxf/xml/delegation"
xmlns:p=" http://www.orbeon.com/oxf/pipeline"
xmlns:v=" http://orbeon.org/oxf/xml/validation"
xmlns:xsi_1=" http://www.w3.org/1999/XMLSchema-instance"
xsi_1:type="xsd:string">There are six types of <b>Alaska</b>
Cruise Vacations. Learn which <b>Alaska</b> Cruise
Vacation<br> is best for you on AlaskaCruises.com.</snippet>
the docs on saxon:serialize didn;t manifest the answer, i saw a
reference to 'xml' on the second parameter from Micheal Kay, but no details.
Richard
Henrik Pettersen wrote:
> Richard,
>
> have a look at these:
>
> fn:escape-uri(stringURI,esc-res):
> http://www.w3schools.com/xpath/xpath_functions.asp>
> http://mail-archive.objectweb.org/ops-users/2006-08/msg00629.html>
> Hope that helps.
>
> Henrik
>
> On 9/4/06, Richard Braman < [hidden email]> wrote:
>> Henrik , Stephen
>> Thanks for the input.
>> here is the code in view.xsl to print the results in google like format,
>> but there are a couple of problems I am not sure how to handle in xslt.
>> First the <title>, <snippet> , and <URL> xml elements complete with type
>> information are actually printing out in the html instead of being
>> filtered out. this is causing the problem of the title not being
>> displayed as title is a html tag. Secondly, the google results have some
>> bold and break tags that are being encoded incorrectly and not rendering
>> right.
>>
>> <xsl:for-each select="/return/resultElements/item">
>> <p>
>> <xsl:copy-of select="title"/>
>> <br/>
>> <xsl:copy-of select="snippet"/>
>> <br/>
>> <xsl:variable name="URL"
>> select="URL"></xsl:variable>
>> <b>
>> <a href="{$URL}"><xsl:copy-of
>> select="URL"></xsl:copy-of></a>
>> </b>
>> <br/>
>> </p>
>> </xsl:for-each>
>>
>> here is html this returns:
>> <p>
>> <title xsi_1:type="xsd:string"><b>SEO</b>
>> Home</title><br><snippet xsi_1:type="xsd:string">Mentor an
>> <b>SEO</b> Scholar! 07 Aug 06. Click here to learn more.
>> <b>...</b> 55 Exchange Place<br> New York, NY
>> 10005 (212)
>> 979-2040 info@<b>seo</b>-usa.org <b>...</b>
>> </snippet><br><b><a href=" http://www.seo-ny.org/">
>> <URL
>> xsi_1:type="xsd:string"> http://www.seo-ny.org/</URL></a></b><br></p>
>> <p>
>>
>>
>> > Richard,
>> >
>> > if you output your data in your xpl as instance data:
>> > <p:param name="instance" type="output" />
>> >
>> > you need to reference this data in the view like this:
>> > <xforms:instance id="user-instance">
>> > <xsl:copy-of select="document('input:instance')"/>
>> > </xforms:instance>
>> >
>> > if you output your data in your xpl as data:
>> > <p:param name="data" type="output" />
>> >
>> > you need to reference this data in the view like this:
>> > <xforms:instance id="user-instance">
>> > <xsl:copy-of select="/"/>
>> > </xforms:instance>
>> >
>> > Also, you can add the attribute 'debug="somename"' to any pipeline
>> > component's <input> or <output> elements to print the content to the
>> > log.
>> >
>> > Hope that helps.
>> >
>> > Henrik
>> >
>> > On 9/2/06, Richard Braman < [hidden email]> wrote:
>> >> I am a little confused about the return values from the model.xpl
>> in the
>> >> Google SOAP sample I posted.
>> >>
>> >> In the view.xsl, there is a stmt that prints out the response from
>> the
>> >> SOAP call like this:
>> >>
>> >> <xsl:if test="doc('input:instance')/query != ''">
>> >>
>> >> <pre><xsl:value-of select="/return"/></pre>
>> >>
>> >> </xsl:if>
>> >>
>> >>
>> >> Without being able to see I return, i cant figure out the XPath
>> needed
>> >> to get to the elements of the response that I am interestd in for
>> >> formatting, namely
>> >> the snippet, URL, etc from the google response.
>> >>
>> >> What would you use as an XPath?
>> >>
>> >> Also does anyone think a WSDL to XPL generator would be a good idea
>> >> for OPS?
>> >>
>> >> Rich
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> 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>> >>
>> >>
>> >>
>> >
>> >
>> ------------------------------------------------------------------------
>> >
>> >
>> > --
>> > 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>> >
>>
>>
>>
>>
>>
>>
>> --
>> 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>>
>>
>>
>
> ------------------------------------------------------------------------
>
>
> --
> 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>
--
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
|
|
Hi Richard
I'm not sure exactly what you're trying to achieve here -- from the
email thread so far I'm assuming that you've been able to view the raw
SOAP response, and have successfully managed to figure out the XPATH for
the elements you wish to display (in a formatted page)?
If this is correct then from your XSL, I gather that the problem is that
you are getting tags (element names) from the SOAP message in the data,
rather than just showing the contents of the elements?
Your XSL reads:
<xsl:for-each select="/return/resultElements/item">
<p>
<xsl:copy-of select="title"/>
<br/>
<xsl:copy-of select="snippet"/>
<br/>
<xsl:variable name="URL" select="URL"></xsl:variable>
<b>
<a href="{$URL}"><xsl:copy-of select="URL"></xsl:copy-of></a>
</b>
<br/>
</p>
</xsl:for-each>
If it's simply a case of placing the text of the element (using xpath
notation) /return/ResultElement/item/title within some html <p></p>
tags, then the solution is simple:
Use <xsl:value-of select="title"> instead of xsl:copy-of.
xsl:copy of will take a copy of the whole element, ie the xml tag and
any text contents will be output. xsl:value-of will take the text
contents of the element.
Or maybe I'm missing something in what you're trying to achieve?
I see you also said that the google results encode some bold and break
tags that are not being rendered correctly -- maybe you could post an
example message that you're getting back, and we can come up with some
XSL to handle this? (this may well involve using some kind of
escaping/serializing solution as per Henrik's suggestion).
Regards
Steve
-----Original Message-----
From: Richard Braman [mailto: [hidden email]]
Sent: 05 September 2006 05:56
To: [hidden email]
Subject: Re: [ops-users] OPS SOAP RETURN VALUES
Hi Henrick,
I am not sure how the escare-uri would help, these are html encodings.
I looked at
saxon:serialize, but I am not sure what to put in the parameters. I
tried
<xsl:copy-of select="saxon:serialize(snippet,'')"/>
but that printed out all sorts of additional xml. like this:
<?xml version="1.0" encoding="UTF-8"?><snippet
xmlns:ns3=" http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xmlns:f=" http://orbeon.org/oxf/xml/formatting"
xmlns:xhtml=" http://www.w3.org/1999/xhtml"
xmlns:oxf=" http://www.orbeon.com/oxf/processors"
xmlns:delegation=" http://orbeon.org/oxf/xml/delegation"
xmlns:p=" http://www.orbeon.com/oxf/pipeline"
xmlns:v=" http://orbeon.org/oxf/xml/validation"
xmlns:xsi_1=" http://www.w3.org/1999/XMLSchema-instance"
xsi_1:type="xsd:string">There are six types of <b>Alaska</b>
Cruise Vacations. Learn which <b>Alaska</b> Cruise
Vacation<br> is best for you on AlaskaCruises.com.</snippet>
the docs on saxon:serialize didn;t manifest the answer, i saw a
reference to 'xml' on the second parameter from Micheal Kay, but no
details.
Richard
Henrik Pettersen wrote:
format,
>> but there are a couple of problems I am not sure how to handle in
xslt.
>> First the <title>, <snippet> , and <URL> xml elements complete with
type
>> information are actually printing out in the html instead of being
>> filtered out. this is causing the problem of the title not being
>> displayed as title is a html tag. Secondly, the google results have
some
>> bold and break tags that are being encoded incorrectly and not
rendering
>> right.
>>
>> <xsl:for-each select="/return/resultElements/item">
>> <p>
>> <xsl:copy-of select="title"/>
>> <br/>
>> <xsl:copy-of select="snippet"/>
>> <br/>
>> <xsl:variable name="URL"
>> select="URL"></xsl:variable>
>> <b>
>> <a href="{$URL}"><xsl:copy-of
>> select="URL"></xsl:copy-of></a>
>> </b>
>> <br/>
>> </p>
>> </xsl:for-each>
>>
>> here is html this returns:
>> <p>
>> <title xsi_1:type="xsd:string"><b>SEO</b>
>> Home</title><br><snippet xsi_1:type="xsd:string">Mentor an
>> <b>SEO</b> Scholar! 07 Aug 06. Click here to learn more.
>> <b>...</b> 55 Exchange Place<br> New York, NY
>> 10005 (212)
>> 979-2040 info@<b>seo</b>-usa.org
<b>...</b>
>> </snippet><br><b><a href=" http://www.seo-ny.org/">
>> <URL
>> xsi_1:type="xsd:string"> http://www.seo-ny.org/</URL></a></b><br></p>
>> <p>
>>
>>
>> > Richard,
>> >
>> > if you output your data in your xpl as instance data:
>> > <p:param name="instance" type="output" />
>> >
>> > you need to reference this data in the view like this:
>> > <xforms:instance id="user-instance">
>> > <xsl:copy-of select="document('input:instance')"/>
>> > </xforms:instance>
>> >
>> > if you output your data in your xpl as data:
>> > <p:param name="data" type="output" />
>> >
>> > you need to reference this data in the view like this:
>> > <xforms:instance id="user-instance">
>> > <xsl:copy-of select="/"/>
>> > </xforms:instance>
>> >
>> > Also, you can add the attribute 'debug="somename"' to any pipeline
>> > component's <input> or <output> elements to print the content to
the
>> > log.
>> >
>> > Hope that helps.
>> >
>> > Henrik
>> >
>> > On 9/2/06, Richard Braman < [hidden email]> wrote:
>> >> I am a little confused about the return values from the model.xpl
>> in the
>> >> Google SOAP sample I posted.
>> >>
>> >> In the view.xsl, there is a stmt that prints out the response from
>> the
>> >> SOAP call like this:
>> >>
>> >> <xsl:if test="doc('input:instance')/query != ''">
>> >>
>> >> <pre><xsl:value-of select="/return"/></pre>
>> >>
>> >> </xsl:if>
>> >>
>> >>
>> >> Without being able to see I return, i cant figure out the XPath
>> needed
>> >> to get to the elements of the response that I am interestd in for
>> >> formatting, namely
>> >> the snippet, URL, etc from the google response.
>> >>
>> >> What would you use as an XPath?
>> >>
>> >> Also does anyone think a WSDL to XPL generator would be a good
idea
>> >> for OPS?
>> >>
>> >> Rich
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> 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>> >>
>> >>
>> >>
>> >
>> >
>>
------------------------------------------------------------------------
http://www.objectweb.org/wws>>
>>
>>
>
>
------------------------------------------------------------------------
>
>
> --
> 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>
--
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
|
|
thanks steve.
changing copy-of to value-of worked on the first problem , now the
remaining problem is the < and > being encoded as < and
> I am sure any encoded char would come up like that instead of
being translated to the html. the html tags( like the <br> tag
and the <b> tag around the URL) that are intact came from my
xslt, the bold tags are encoded incorrectly were included in google's
response. I dont know why google includes html body tags in their
response, whicc isn't vert standard, but i guess that they want to
highlight hits in the fields for the end user.
here is the output
<p><b>Alaska</b> Deals<br>Find <b>Alaska</b> Deals information on AlaskaCruises.com.<br><b><a href="http://www.alaskacruises.com/alaska_deals.asp">http://www.alaskacruises.com/alaska_deals.asp</a></b><br></p>
here is the relevant portion from the view:
<xsl:for-each select="/return/resultElements/item">
<p>
<xsl:value-of select="title"/>
<br/>
<xsl:value-of select="snippet"/>
<br/>
<xsl:variable name="URL"
select="URL"></xsl:variable>
<b>
<a href="{$URL}"><xsl:value-of
select="URL"></xsl:value-of></a>
</b>
<br/>
</p>
</xsl:for-each>
Stephen Bayliss wrote:
Hi Richard
I'm not sure exactly what you're trying to achieve here -- from the
email thread so far I'm assuming that you've been able to view the raw
SOAP response, and have successfully managed to figure out the XPATH for
the elements you wish to display (in a formatted page)?
If this is correct then from your XSL, I gather that the problem is that
you are getting tags (element names) from the SOAP message in the data,
rather than just showing the contents of the elements?
Your XSL reads:
<xsl:for-each select="/return/resultElements/item">
<p>
<xsl:copy-of select="title"/>
<br/>
<xsl:copy-of select="snippet"/>
<br/>
<xsl:variable name="URL" select="URL"></xsl:variable>
<b>
<a href="{$URL}"><xsl:copy-of select="URL"></xsl:copy-of></a>
</b>
<br/>
</p>
</xsl:for-each>
If it's simply a case of placing the text of the element (using xpath
notation) /return/ResultElement/item/title within some html <p></p>
tags, then the solution is simple:
Use <xsl:value-of select="title"> instead of xsl:copy-of.
xsl:copy of will take a copy of the whole element, ie the xml tag and
any text contents will be output. xsl:value-of will take the text
contents of the element.
Or maybe I'm missing something in what you're trying to achieve?
I see you also said that the google results encode some bold and break
tags that are not being rendered correctly -- maybe you could post an
example message that you're getting back, and we can come up with some
XSL to handle this? (this may well involve using some kind of
escaping/serializing solution as per Henrik's suggestion).
Regards
Steve
-----Original Message-----
From: Richard Braman [[hidden email]]
Sent: 05 September 2006 05:56
To: [hidden email]
Subject: Re: [ops-users] OPS SOAP RETURN VALUES
Hi Henrick,
I am not sure how the escare-uri would help, these are html encodings.
I looked at
saxon:serialize, but I am not sure what to put in the parameters. I
tried
<xsl:copy-of select="saxon:serialize(snippet,'')"/>
but that printed out all sorts of additional xml. like this:
<?xml version="1.0" encoding="UTF-8"?><snippet
xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:delegation="http://orbeon.org/oxf/xml/delegation"
xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:v="http://orbeon.org/oxf/xml/validation"
xmlns:xsi_1="http://www.w3.org/1999/XMLSchema-instance"
xsi_1:type="xsd:string">There are six types of <b>Alaska</b>
Cruise Vacations. Learn which <b>Alaska</b> Cruise
Vacation<br> is best for you on AlaskaCruises.com.</snippet>
the docs on saxon:serialize didn;t manifest the answer, i saw a
reference to 'xml' on the second parameter from Micheal Kay, but no
details.
Richard
Henrik Pettersen wrote:
Richard,
have a look at these:
fn:escape-uri(stringURI,esc-res):
http://www.w3schools.com/xpath/xpath_functions.asp
http://mail-archive.objectweb.org/ops-users/2006-08/msg00629.html
Hope that helps.
Henrik
On 9/4/06, Richard Braman [hidden email] wrote:
Henrik , Stephen
Thanks for the input.
here is the code in view.xsl to print the results in google like
format,
but there are a couple of problems I am not sure how to handle in
xslt.
First the <title>, <snippet> , and <URL> xml elements complete with
type
information are actually printing out in the html instead of being
filtered out. this is causing the problem of the title not being
displayed as title is a html tag. Secondly, the google results have
some
bold and break tags that are being encoded incorrectly and not
rendering
right.
<xsl:for-each select="/return/resultElements/item">
<p>
<xsl:copy-of select="title"/>
<br/>
<xsl:copy-of select="snippet"/>
<br/>
<xsl:variable name="URL"
select="URL"></xsl:variable>
<b>
<a href="{$URL}"><xsl:copy-of
select="URL"></xsl:copy-of></a>
</b>
<br/>
</p>
</xsl:for-each>
here is html this returns:
<p>
<title xsi_1:type="xsd:string"><b>SEO</b>
Home</title><br><snippet xsi_1:type="xsd:string">Mentor an
<b>SEO</b> Scholar! 07 Aug 06. Click here to learn more.
<b>...</b> 55 Exchange Place<br> New York, NY
10005 (212)
979-2040 [hidden email]
<b>...</b>
</snippet><br><b><a href="http://www.seo-ny.org/">
<URL
xsi_1:type="xsd:string">http://www.seo-ny.org/</URL></a></b><br></p>
<p>
Richard,
if you output your data in your xpl as instance data:
<p:param name="instance" type="output" />
you need to reference this data in the view like this:
<xforms:instance id="user-instance">
<xsl:copy-of select="document('input:instance')"/>
</xforms:instance>
if you output your data in your xpl as data:
<p:param name="data" type="output" />
you need to reference this data in the view like this:
<xforms:instance id="user-instance">
<xsl:copy-of select="/"/>
</xforms:instance>
Also, you can add the attribute 'debug="somename"' to any pipeline
component's <input> or <output> elements to print the content to
the
log.
Hope that helps.
Henrik
On 9/2/06, Richard Braman [hidden email] wrote:
I am a little confused about the return values from the model.xpl
in the
Google SOAP sample I posted.
In the view.xsl, there is a stmt that prints out the response from
the
SOAP call like this:
<xsl:if test="doc('input:instance')/query != ''">
<pre><xsl:value-of select="/return"/></pre>
</xsl:if>
Without being able to see I return, i cant figure out the XPath
needed
to get to the elements of the response that I am interestd in for
formatting, namely
the snippet, URL, etc from the google response.
What would you use as an XPath?
Also does anyone think a WSDL to XPL generator would be a good
idea
for OPS?
Rich
--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws
------------------------------------------------------------------------
--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws
--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws
------------------------------------------------------------------------
--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws
--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: [hidden email]
For general help: [hidden email]
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
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
|
|
Yes I just had a quick look here and I can
see the same thing in the raw SOAP message returned from Google. Ugly!
If you can live with loosing the bold tags
entirely, you could use the replace function. For instance
<p>
<xsl:variable name="text"
select="title"></xsl:variable>
<xsl:variable name=”textUntagged”
select=”replace($text,’<b>’,’’)”/>
<xsl:value-of select=”$textUntagged”/>
….etc….
</p>
That should get rid of the opening
tag. Nest the function to get rid of both, eg
<xsl:variable name=”textUntagged”
select=”replace(replace($text,’<b>’,’’),’</b>’,’’)”/>
Actually in my raw SOAP output, I see the
tags as <b> (ie only the opening < is escaped) so you
might want to try the following as an alternative
<xsl:variable name=”textUntagged”
select=”replace(replace($text,’<b>’,’’),’</b>’,’’)”/>
Not a particularly elegant solution, maybe
someone has a better idea?
I would have thought this would be quite a
common problem, so you might find more by searching around.
Steve
From: Richard Braman [mailto:[hidden email]]
Sent: 05 September 2006 21:46
To: [hidden email]
Subject: Re: [ops-users] OPS SOAP
RETURN VALUES
thanks steve.
changing copy-of to value-of worked on the first problem , now the remaining
problem is the < and > being encoded as < and > I am sure
any encoded char would come up like that instead of being translated to the
html. the html tags( like the <br> tag and the <b> tag around the
URL) that are intact came from my xslt, the bold tags are encoded incorrectly
were included in google's response. I dont know why google includes html
body tags in their response, whicc isn't vert standard, but i guess that they
want to highlight hits in the fields for the end user.
here is the output
<p><b>Alaska</b> Deals<br>Find <b>Alaska</b> Deals information on AlaskaCruises.com.<br><b><a href="http://www.alaskacruises.com/alaska_deals.asp">http://www.alaskacruises.com/alaska_deals.asp</a></b><br></p> here is the relevant portion from the view:
<xsl:for-each
select="/return/resultElements/item">
<p>
<xsl:value-of
select="title"/>
<br/>
<xsl:value-of
select="snippet"/>
<br/>
n
<b>
<a href="{$URL}"><xsl:value-of
select="URL"></xsl:value-of></a>
</b>
<br/>
</p>
</xsl:for-each>
Stephen Bayliss wrote:
Hi Richard I'm not sure exactly what you're trying to achieve here -- from the email thread so far I'm assuming that you've been able to view the raw SOAP response, and have successfully managed to figure out the XPATH for the elements you wish to display (in a formatted page)? If this is correct then from your XSL, I gather that the problem is that you are getting tags (element names) from the SOAP message in the data, rather than just showing the contents of the elements? Your XSL reads: <xsl:for-each select="/return/resultElements/item"> <p> <xsl:copy-of select="title"/> <br/> <xsl:copy-of select="snippet"/> <br/> <xsl:variable name="URL" select="URL"></xsl:variable> <b> <a href="{$URL}"><xsl:copy-of select="URL"></xsl:copy-of></a> </b> <br/> </p> </xsl:for-each> If it's simply a case of placing the text of the element (using xpath notation) /return/ResultElement/item/title within some html <p></p> tags, then the solution is simple: Use <xsl:value-of select="title"> instead of xsl:copy-of. xsl:copy of will take a copy of the whole element, ie the xml tag and any text contents will be output. xsl:value-of will take the text contents of the element. Or maybe I'm missing something in what you're trying to achieve? I see you also said that the google results encode some bold and break tags that are not being rendered correctly -- maybe you could post an example message that you're getting back, and we can come up with some XSL to handle this? (this may well involve using some kind of escaping/serializing solution as per Henrik's suggestion). Regards Steve -----Original Message----- From: Richard Braman [[hidden email]] Sent: 05 September 2006 05:56 To: [hidden email] Subject: Re: [ops-users] OPS SOAP RETURN VALUES Hi Henrick, I am not sure how the escare-uri would help, these are html encodings. I looked at saxon:serialize, but I am not sure what to put in the parameters. I tried <xsl:copy-of select="saxon:serialize(snippet,'')"/> but that printed out all sorts of additional xml. like this: <?xml version="1.0" encoding="UTF-8"?><snippet xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:delegation="http://orbeon.org/oxf/xml/delegation" xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:v="http://orbeon.org/oxf/xml/validation" xmlns:xsi_1="http://www.w3.org/1999/XMLSchema-instance" xsi_1:type="xsd:string">There are six types of <b>Alaska</b> Cruise Vacations. Learn which <b>Alaska</b> Cruise Vacation<br> is best for you on AlaskaCruises.com.</snippet> the docs on saxon:serialize didn;t manifest the answer, i saw a reference to 'xml' on the second parameter from Micheal Kay, but no details. Richard Henrik Pettersen wrote:
Richard, have a look at these: fn:escape-uri(stringURI,esc-res): http://www.w3schools.com/xpath/xpath_functions.asp http://mail-archive.objectweb.org/ops-users/2006-08/msg00629.html Hope that helps. Henrik On 9/4/06, Richard Braman [hidden email] wrote:
Henrik , Stephen Thanks for the input. here is the code in view.xsl to print the results in google like
format,
but there are a couple of problems I am not sure how to handle in
xslt.
First the <title>, <snippet> , and <URL> xml elements complete with
type
information are actually printing out in the html instead of being filtered out. this is causing the problem of the title not being displayed as title is a html tag. Secondly, the google results have
some
bold and break tags that are being encoded incorrectly and not
rendering
right. <xsl:for-each select="/return/resultElements/item"> <p> <xsl:copy-of select="title"/> <br/> <xsl:copy-of select="snippet"/> <br/> <xsl:variable name="URL" select="URL"></xsl:variable> <b> <a href="{$URL}"><xsl:copy-of select="URL"></xsl:copy-of></a> </b> <br/> </p> </xsl:for-each> here is html this returns: <p> <title xsi_1:type="xsd:string"><b>SEO</b> Home</title><br><snippet xsi_1:type="xsd:string">Mentor an <b>SEO</b> Scholar! 07 Aug 06. Click here to learn more. <b>...</b> 55 Exchange Place<br> New York, NY 10005 (212) 979-2040 [hidden email]
<b>...</b>
</snippet><br><b><a href="http://www.seo-ny.org/"> <URL xsi_1:type="xsd:string">http://www.seo-ny.org/</URL></a></b><br></p> <p>
Richard, if you output your data in your xpl as instance data: <p:param name="instance" type="output" /> you need to reference this data in the view like this: <xforms:instance id="user-instance"> <xsl:copy-of select="document('input:instance')"/> </xforms:instance> if you output your data in your xpl as data: <p:param name="data" type="output" /> you need to reference this data in the view like this: <xforms:instance id="user-instance"> <xsl:copy-of select="/"/> </xforms:instance> Also, you can add the attribute 'debug="somename"' to any pipeline component's <input> or <output> elements to print the content to
the
log.
|
Administrator
|
Ryan,
This does not seem to happen all the time, as the attached example
works. Could this be because your current context is set to a node-set
that belongs to another instance?
-Erik
Ryan Puddephatt wrote:
> All,
> I have noticed that from @value you cannot access the default
> instance through /root-node/element you have to use
> instance('main-instance')/element. Is this for a reason or a bug?
>
> Thanks
>
> Ryan
>
> Ryan Puddephatt
> Software Engineer
>
>
> Teleflex Group - IT UK
> 1 Michaelson Square
> Livingston
> West Lothian
> Scotland
> EH54 7DP
>
> e> [hidden email] <mailto: [hidden email]>
> t> +44(0)1506 407 110
> f> +44(0)1506 407 108
> w> www.teleflex.com < http://www.teleflex.com/>
--
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
|
|