xslt and xlink question

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

xslt and xlink question

Hank Ratzesberger

I am consuming a webservice that returns data like the
example below, which has xlink attributes for most of the
elements.  I find that I am unable to use this data,
all my xpath expressions like
<xsl:value-of select="/feeds/feed/@id" />
return empty content, whereas, if I remove the xlink
attribute, I get expected values.

Is this normal behavior for xslt? Is it evaluating the
xlink attribute in some way?  Should I go ahead and
pre-process the xml to remove the xlink attributes?

Thanks for any insights,
Hank


<feeds xlink:href="http://tpm.nees.ucsb.edu/feeds">
 <feed id="Garner_Valley" xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley">
   <stream id="High-Res" xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res">
     <video-box-size>large</video-box-size>
     <max-connection-length>240</max-connection-length>
     <jpeg xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/jpeg"></jpeg>
     <mjpeg xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/mjpeg">
....

Hank Ratzesberger
NEES Programmer
Institute for Crustal Studies
University of California, Santa Barbara




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

Pattern matching with OPS3

mjgraham
Hi,

Under 2.8, the following worked:

<xforms:bind
nodeset="/form/document/vr:Resource/vr:curation/vr:creator/vr:name/@ivo-id"
type="xs:anyURI" constraint="string-length(.) = 0 or matches(.,
&quot;ivo://[\w\d][\w\d\-_\.!~\*'\(\)\+=]{2,}(/[\w\d\-_\.!~\*'\(\)\+=]+(/[\w\d\-_\.!~\*'\(\)\+=])*)?&quot;)"/>

With 3.0beta3, I have to change: {2,} to 2, to get this to work - is
this a bug?

    Cheers,

    Matthew



--
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: xslt and xlink question

Hank Ratzesberger
In reply to this post by Hank Ratzesberger

Actually, the problem seems related to its own
namespace, not the xlink namespace or attributes.

Thanks,
Hank


----- Original Message -----
From: "Hank Ratzesberger" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, September 14, 2005 8:56 AM
Subject: [ops-users] xslt and xlink question


>
> I am consuming a webservice that returns data like the
> example below, which has xlink attributes for most of the
> elements.  I find that I am unable to use this data,
> all my xpath expressions like
> <xsl:value-of select="/feeds/feed/@id" />
> return empty content, whereas, if I remove the xlink
> attribute, I get expected values.
>
> Is this normal behavior for xslt? Is it evaluating the
> xlink attribute in some way?  Should I go ahead and
> pre-process the xml to remove the xlink attributes?
>
> Thanks for any insights,
> Hank
>
>
> <feeds xlink:href="http://tpm.nees.ucsb.edu/feeds">
> <feed id="Garner_Valley" xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley">
>   <stream id="High-Res" xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res">
>     <video-box-size>large</video-box-size>
>     <max-connection-length>240</max-connection-length>
>     <jpeg xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/jpeg"></jpeg>
>     <mjpeg xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/mjpeg">
> ....
>
> Hank Ratzesberger
> NEES Programmer
> Institute for Crustal Studies
> University of California, Santa Barbara
>
>
>

--------------------------------------------------------------------------------


>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

RE: xslt and xlink question

cknell
In reply to this post by Hank Ratzesberger
This kind of question pops up frequently on the XSLT list at MulberryTech (http://www.mulberrytech.com/xsl/xsl-list). Post this on that list and you will get a quick, authoritative reply.

---
Charles Knell
[hidden email] - email



-----Original Message-----
From:     Hank Ratzesberger <[hidden email]>
Sent:     Wed, 14 Sep 2005 08:56:50 -0700
To:       <[hidden email]>
Subject:  [ops-users] xslt and xlink question


I am consuming a webservice that returns data like the
example below, which has xlink attributes for most of the
elements.  I find that I am unable to use this data,
all my xpath expressions like
<xsl:value-of select="/feeds/feed/@id" />
return empty content, whereas, if I remove the xlink
attribute, I get expected values.

Is this normal behavior for xslt? Is it evaluating the
xlink attribute in some way?  Should I go ahead and
pre-process the xml to remove the xlink attributes?

Thanks for any insights,
Hank


<feeds xlink:href="http://tpm.nees.ucsb.edu/feeds">
 <feed id="Garner_Valley" xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley">
   <stream id="High-Res" xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res">
     <video-box-size>large</video-box-size>
     <max-connection-length>240</max-connection-length>
     <jpeg xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/jpeg"></jpeg>
     <mjpeg xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/mjpeg">
...

Hank Ratzesberger
NEES Programmer
Institute for Crustal Studies
University of California, Santa Barbara



--
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
Reply | Threaded
Open this post in threaded view
|

Re: xslt and xlink question

Smith, Donald
In reply to this post by Hank Ratzesberger
Hank,

This is not normal behavior for XSLT. In fact, it strongly suggests a
bug somewhere.

Your <xsl:value-of /> uses an XPath location path in the "select"
attribute that starts at the root node of the document (signified by the
opening "/"), and then moves down the hierarchy of the document to the
"feed" element node. At that point it moves onto the attribute axis and
retrieves the value of the "id" attribute. All that is just fine.

The "xlink:href" attribute on the <feed> element can't affect your XPath
at all. That it apparently does affect it is quite strange, and it's
difficult for me to think that any XSLT engine would have such a bug at
this point in the life of XSLT.

And, no, given the XPath you've written, there is no reason for the XSLT
engine to be evaluating the xlink attribute at that point.

I can't suggest what to do as far as pre-processing; it's certainly a
shame to have to write a process to avoid something that should not be
happening to begin with. Perhaps if I knew more I could suggest why this
is happening, but I'm not sure.

Don

Director of XML Training/Professional Services Analyst
Innodata Isogen
214-954-5110

Hank Ratzesberger wrote:

>
> I am consuming a webservice that returns data like the example below,
> which has xlink attributes for most of the elements.  I find that I am
> unable to use this data, all my xpath expressions like <xsl:value-of
> select="/feeds/feed/@id" />
> return empty content, whereas, if I remove the xlink attribute, I get
> expected values.
>
> Is this normal behavior for xslt? Is it evaluating the xlink attribute
> in some way?  Should I go ahead and pre-process the xml to remove the
> xlink attributes?
>
> Thanks for any insights,
> Hank
>
>
> <feeds xlink:href="http://tpm.nees.ucsb.edu/feeds">
> <feed id="Garner_Valley"
> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley">
>   <stream id="High-Res"
> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res">
>     <video-box-size>large</video-box-size>
>     <max-connection-length>240</max-connection-length>
>     <jpeg
> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/jpeg"></jpeg>
>
>     <mjpeg
> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/mjpeg">
> ....
>
> Hank Ratzesberger
> NEES Programmer
> Institute for Crustal Studies
> University of California, Santa Barbara
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

Re: xslt and xlink question

Erik Bruchez
Administrator
In reply to this post by Hank Ratzesberger
Hank, have you been able to track down this issue?

-Erik

Hank Ratzesberger wrote:

>
> Actually, the problem seems related to its own namespace, not the xlink
> namespace or attributes.
>
> Thanks,
> Hank
>
>
> ----- Original Message ----- From: "Hank Ratzesberger"
> <[hidden email]>
> To: <[hidden email]>
> Sent: Wednesday, September 14, 2005 8:56 AM
> Subject: [ops-users] xslt and xlink question
>
>
>>
>> I am consuming a webservice that returns data like the example below,
>> which has xlink attributes for most of the elements.  I find that I am
>> unable to use this data, all my xpath expressions like <xsl:value-of
>> select="/feeds/feed/@id" />
>> return empty content, whereas, if I remove the xlink attribute, I get
>> expected values.
>>
>> Is this normal behavior for xslt? Is it evaluating the xlink attribute
>> in some way?  Should I go ahead and pre-process the xml to remove the
>> xlink attributes?
>>
>> Thanks for any insights,
>> Hank
>>
>>
>> <feeds xlink:href="http://tpm.nees.ucsb.edu/feeds">
>> <feed id="Garner_Valley"
>> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley">
>>   <stream id="High-Res"
>> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res">
>>     <video-box-size>large</video-box-size>
>>     <max-connection-length>240</max-connection-length>
>>     <jpeg
>> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/jpeg"></jpeg>
>>
>>     <mjpeg
>> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/mjpeg">
>> ....
>>
>> Hank Ratzesberger
>> NEES Programmer
>> Institute for Crustal Studies
>> University of California, Santa Barbara
>>
>>
>>
>
>
> --------------------------------------------------------------------------------
>
>
>
>>
>> --
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Pattern matching with OPS3

Erik Bruchez
Administrator
In reply to this post by mjgraham
Matthew Graham wrote:

> Hi,
>
> Under 2.8, the following worked:
>
> <xforms:bind
> nodeset="/form/document/vr:Resource/vr:curation/vr:creator/vr:name/@ivo-id"
> type="xs:anyURI" constraint="string-length(.) = 0 or matches(.,
> &quot;ivo://[\w\d][\w\d\-_\.!~\*'\(\)\+=]{2,}(/[\w\d\-_\.!~\*'\(\)\+=]+(/[\w\d\-_\.!~\*'\(\)\+=])*)?&quot;)"/>
>
>
> With 3.0beta3, I have to change: {2,} to 2, to get this to work - is
> this a bug?

The Saxon XPath engine is used, and for now it is the same used in 2.8,
so there shuld not be a difference. Also, replacing "{2,}" with "2,"
will probably change the behavior of your regexp!

-Erik



--
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: xslt and xlink question

Hank Ratzesberger
In reply to this post by Erik Bruchez

The issue appears to be related to the request-generator.  

The URL:

http://nees.ucsb.edu/imageserver/gvda?set=gvda&amp;image=img001.jpg&amp;width=163&amp;height=122

for example, after parsing by the request-generator yields
the following, in which the query-string has been encoded.
So, it is being encoded twice and this results in a
"filename" that can't be used by the cache.

--Hank

<root>
 <request>
  <parameters>
   <parameter>
    <name>amp;height</name>
    <value>122</value>
   </parameter>
   <parameter>
    <name>set</name>
    <value>gvda</value>
   </parameter>
   <parameter>
    <name>amp;image</name>
    <value>img001.jpg</value>
   </parameter>
   <parameter>
    <name>amp;width</name>
    <value>163</value>
   </parameter>
  </parameters>
  <query-string>set=gvda&amp;amp;image=img001.jpg&amp;amp;width=163&amp;amp;height=122</query-string>
 </request>
 <config xmlns:p="http://www.orbeon.com/oxf/pipeline">
  <image-directory>oxf:/imageserver</image-directory>
  <default-quality>0.7</default-quality>
  <use-sandbox>false</use-sandbox>
 </config>
 <image xmlns:p="http://www.orbeon.com/oxf/pipeline">
  <path>gvda/</path>
  <use-cache>true</use-cache>
  <transform type="scale">
   <width/>
   <height/>
  </transform>
 </image>
</root>

----- Original Message -----
From: "Erik Bruchez" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, September 22, 2005 3:30 PM
Subject: Re: [ops-users] xslt and xlink question


> Hank, have you been able to track down this issue?
>
> -Erik
>
> Hank Ratzesberger wrote:
>>
>> Actually, the problem seems related to its own namespace, not the xlink
>> namespace or attributes.
>>
>> Thanks,
>> Hank
>>
>>
>> ----- Original Message ----- From: "Hank Ratzesberger"
>> <[hidden email]>
>> To: <[hidden email]>
>> Sent: Wednesday, September 14, 2005 8:56 AM
>> Subject: [ops-users] xslt and xlink question
>>
>>
>>>
>>> I am consuming a webservice that returns data like the example below,
>>> which has xlink attributes for most of the elements.  I find that I am
>>> unable to use this data, all my xpath expressions like <xsl:value-of
>>> select="/feeds/feed/@id" />
>>> return empty content, whereas, if I remove the xlink attribute, I get
>>> expected values.
>>>
>>> Is this normal behavior for xslt? Is it evaluating the xlink attribute
>>> in some way?  Should I go ahead and pre-process the xml to remove the
>>> xlink attributes?
>>>
>>> Thanks for any insights,
>>> Hank
>>>
>>>
>>> <feeds xlink:href="http://tpm.nees.ucsb.edu/feeds">
>>> <feed id="Garner_Valley"
>>> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley">
>>>   <stream id="High-Res"
>>> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res">
>>>     <video-box-size>large</video-box-size>
>>>     <max-connection-length>240</max-connection-length>
>>>     <jpeg
>>> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/jpeg"></jpeg>
>>>
>>>     <mjpeg
>>> xlink:href="http://tpm.nees.ucsb.edu/feeds/Garner_Valley/High-Res/mjpeg">
>>> ....
>>>
>>> Hank Ratzesberger
>>> NEES Programmer
>>> Institute for Crustal Studies
>>> University of California, Santa Barbara



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

Hiring java/xml developer in London to do OPS work..

damonrand
Hi people,

If anyone knows a keen java/xml developer in London then please forward this
link on to them.. The job will be half ops and half swt/jface.

http://web.amnesty.org/jobs/index/14092005-ITP0504

Regards,
Damon.




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