cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Schmidt, Maik, MTC-DTM, ST" <Maik.Schm...@PASSO.DE>
Subject Small bug in XSPUtil.toMarkup?
Date Wed, 04 Oct 2000 12:34:44 GMT

I think, I have found a small bug in XSPUtil.toMarkup, that leads to
problems with attribute values containing XML's special characters '<', '>'
and '&'.

So, if you call XSPUtil.toMarkup on a document containing the element
'<Service name="Park&Ride"/>', the function won't work properly, i.e.,
returning the string '<Service name="Park&amp;Ride"/>'.

In my opinion the problem is in the Method doMarkup:

case Node.ELEMENT_NODE: {
  Element element = (Element) node;

  buffer.append("<" + element.getTagName());

  NamedNodeMap attributes = element.getAttributes();
  int attributeCount = attributes.getLength();

  for (int i = 0; i < attributeCount; i++) {
    Attr attribute = (Attr) attributes.item(i);

    buffer.append(" ");
    buffer.append(attribute.getValue());  //  This one has to be

Best regards,


View raw message