Tapestry
  1. Tapestry
  2. TAPESTRY-245

Using "Any" component in XML generation should render an empty tag if there is no body

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.1
    • Fix Version/s: 4.1.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      JDK 1.5 Tomcat

      Description

      For certain types of XML generation (VoiceXML, for example) it is illegal to have a opening and closing tag for certain tag sets. When using the "Any" component to generate an XML tag that has no body, it generates a closing tag when what it should render is an empty tag.

      For example, if in VXML you have:
      <var jwcid="@Any" name="myVar" expr="someVal"/>

      The Any component generates:
      <var name="myVar" expr="someVal"></var>

      Which is ignored by most VoiceXML 2.0 compliant browsers. If the tag detected that there were no body present and did a writer.beginEmpty(), all would be well!

        Activity

        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12566990 ] jira [ 12589746 ]
        Mark Thomas made changes -
        Workflow jira [ 39321 ] Default workflow, editable Closed status [ 12566990 ]
        Jesse Kuhnert made changes -
        Fix Version/s 4.1.1 [ 12312021 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Brian K. Wallace made changes -
        Field Original Value New Value
        Component/s Framework [ 11280 ]
        Hide
        Vjeran Marcinko added a comment -

        Just to add that example of XML generation in docs for Any component:
        http://jakarta.apache.org/tapestry/doc/ComponentReference/Any.html
        use plain BasePage, thus rendered XML response has text/html content type, which is something none would want I guess...

        Show
        Vjeran Marcinko added a comment - Just to add that example of XML generation in docs for Any component: http://jakarta.apache.org/tapestry/doc/ComponentReference/Any.html use plain BasePage, thus rendered XML response has text/html content type, which is something none would want I guess...
        Hide
        Vjeran Marcinko added a comment -

        How did you generate XML? Have you used HTMLWriter and used it to create some base XML page like:

        public class XmlPage extends AbstractPage {
        public IMarkupWriter getResponseWriter(OutputStream out)

        { return new HTMLWriter("text/xml", out); }

        }
        or did you developer your own IMarkupWriter implementation for plain XML (XMLWriter) ?

        I can see that HTMLWriter has possibility to set content type, but I would like also to know is it sufficient for XML rendering, or is it needed some new XMLWriter for proper work?

        Whatever, I think that Tapestry should include some "base XML page" (with according XMLWriter) since it doesn't look like big addition, and lot of coworkers gave me scowl when I told them that Tapestry is mainly for HTML.

        -Vjeran

        Show
        Vjeran Marcinko added a comment - How did you generate XML? Have you used HTMLWriter and used it to create some base XML page like: public class XmlPage extends AbstractPage { public IMarkupWriter getResponseWriter(OutputStream out) { return new HTMLWriter("text/xml", out); } } or did you developer your own IMarkupWriter implementation for plain XML (XMLWriter) ? I can see that HTMLWriter has possibility to set content type, but I would like also to know is it sufficient for XML rendering, or is it needed some new XMLWriter for proper work? Whatever, I think that Tapestry should include some "base XML page" (with according XMLWriter) since it doesn't look like big addition, and lot of coworkers gave me scowl when I told them that Tapestry is mainly for HTML. -Vjeran
        Kurtis Williams created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Kurtis Williams
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development