cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph Ferner" <josephfer...@cox.net>
Subject Problem using jpath and xsp tags together (possible bug or just misunderstanding)
Date Fri, 03 Oct 2003 20:38:15 GMT
The Problem:
I'm trying to create an xml document using xsp and jpath that looks like
this:
<root>
  <element value="myval">
    <subelement/>
  </element>
  <element>
    <subelement/>
  </element>
</root>

The object I'm pulling from will either return null or another object
which has the string in it (in this case "myval")

So I wrote code like this (xsp):
...
<root>
  <jpath:for-each select="elems">
    <element>
      <jpath:if test="./someObject">
        <xsp:attribute name="value">
          <jpath:value-of select="./someObject/myString"/>
        </xsp:attribute>
      </jpath:if>
	<subelement/>
    </element>
  </jpath:for-each>
</root>
...

I get this from the above code: (the value is in the wrong element)
<root>
  <element>
    <subelement value="myval"/>
  </element>
  <element>
    <subelement/>
  </element>
</root>


So then I tried this:
...
<root>
  <jpath:for-each select="elems">
    <element>
      <xsp:attribute name="value">
        <jpath:if test="./someObject">
          <jpath:value-of select="./someObject/myString"/>
        </jpath:if>
      </xsp:attribute>
	<subelement/>
    </element>
  </jpath:for-each>
</root>
...

And I get this every time: (no value)
<root>
  <element value="">
    <subelement/>
  </element>
  <element value="">
    <subelement/>
  </element>
</root>

I then looked at the generated java code for the second try and the
jpath code is never generated in the java file.

Joseph Ferner


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message