You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Upayavira <uv...@upaya.co.uk> on 2003/07/04 15:38:26 UTC

jxpath in XML comments

Guys,

I'm just starting to work with jxpath, and have found that commenting out (using 
XML comments) a jxpath expression doesn't get ignored. Should it?

I removed a value from my SendPageAndWait(), and commented out the 
parameter, but the page wouldn't work - I had to delete the reference to the 
parameter entirely.

Make sense?

Regards, Upayavira
 

Re: jxpath in XML comments

Posted by Christopher Oliver <re...@verizon.net>.
Ok, now you've jogged my memory: yes it does do substitution even in 
comments.  I'm not sure if it's useful, but that allows you to 
"generate" comments. But go ahead and remove that behavior if you think 
that would be better without it.

Regards,
Chris

Upayavira wrote:

>On 4 Jul 2003 at 11:53, Christopher Oliver wrote:
>
>  
>
>>Can you explain what you mean in more detail? As far as I can tell
>>from your description, what you're trying to do should work.
>>    
>>
>
>Say I had this jxpath file:
>
><parameters xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
>  <from>${from}</from>
>  <to>${to}</to>
>  <status>${status}</status>
></parameters>  
>
>And this SendPage:
>sendPage("page.html", {"from": from, "to" : to, "status": status} );
>
>Then you decide you don't need status, so it becomes:
>
>sendPage("page.html", {"from": from, "to" :to} );
>
>And you change your jxpath to:
><parameters xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
>  <from>${from}</from>
>  <to>${to}</to>
><!--  <status>${status}</status>-->
></parameters>  
>
>You'll get an error, as it can't find $status. So it is still trying to do a replacement, even 
>inside the XML comments. I'm wondering if this is the intentional behaviour.
>
>Regards, Upayavira
>
>
>
>  
>



Re: jxpath in XML comments

Posted by Upayavira <uv...@upaya.co.uk>.
On 4 Jul 2003 at 11:53, Christopher Oliver wrote:

> Can you explain what you mean in more detail? As far as I can tell
> from your description, what you're trying to do should work.

Say I had this jxpath file:

<parameters xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
  <from>${from}</from>
  <to>${to}</to>
  <status>${status}</status>
</parameters>  

And this SendPage:
sendPage("page.html", {"from": from, "to" : to, "status": status} );

Then you decide you don't need status, so it becomes:

sendPage("page.html", {"from": from, "to" :to} );

And you change your jxpath to:
<parameters xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
  <from>${from}</from>
  <to>${to}</to>
<!--  <status>${status}</status>-->
</parameters>  

You'll get an error, as it can't find $status. So it is still trying to do a replacement, even 
inside the XML comments. I'm wondering if this is the intentional behaviour.

Regards, Upayavira



Re: jxpath in XML comments

Posted by Christopher Oliver <re...@verizon.net>.
Can you explain what you mean in more detail? As far as I can tell from 
your description, what you're trying to do should work.

Chris

Upayavira wrote:

>Guys,
>
>I'm just starting to work with jxpath, and have found that commenting out (using 
>XML comments) a jxpath expression doesn't get ignored. Should it?
>
>I removed a value from my SendPageAndWait(), and commented out the 
>parameter, but the page wouldn't work - I had to delete the reference to the 
>parameter entirely.
>
>Make sense?
>
>Regards, Upayavira
> 
>
>  
>