[jdom-interest] Suggestions

Gwenael Treguier gtreguie at inexware.fr
Thu Dec 21 01:07:18 PST 2000


Hello,
Thanks for your response.
You are right, all these suggestions are too specific.
Best Regards.
Gwenn.
On Wednesday 20 December 2000 23:56, you wrote:
> Gwenael Treguier wrote:
> > Hello,
> > First, I often use CDATA to pass binary data (ie, MD5 encoded password).
> > To pass this data, I have to encode the bytes in Base64.
> > Could it be possible to add this feature to JDOM :
>
> A base64 encoder in JDOM?  Hmm...  Seems a bit out of place.  I do see
> the use case though.  Lots of people want to store binary data in XML
> files and use Base64 to do it.  If people out there would find this
> really useful, speak up.
>
> > Second, but here I am not sure for the XML Specification, when you have a
> > reference to an entity in a plain text (ie, Dear &name;,), it seems
> > complex to parse the string to find entity and then do addContent("Dear
> > ").addContent(new Entity(name)).addContent(",");
> > If you just setText("Dear &name;,"), XMLOuputter gives Dear &name;,
> > It could be done in XMLOutputter with :
> >   protected String escapeElementEntities(String st) {
> >
> >      case '&' :
> >  +      if (!isEntity(st.substring(i+1, st.length())))
> >          stEntity = "&";
> >   }
> >
> >     public boolean isEntity(String str)
> >     {
> >        int pos = str.indexOf(';');
> >        if (pos != -1 &&
> > org.jdom.Verifier.checkElementName(str.substring(0, pos)) == null)
> >          return true;
> >        return false;
> >     }
>
> That causes all kinds of irregularities because the tree structure
> wouldn't be a true representation anymore.  It'd be part-tree and
> part-XML-string.
>
> -jh-



More information about the jdom-interest mailing list