Code Monkey home page Code Monkey logo

Comments (5)

cowtowncoder avatar cowtowncoder commented on May 29, 2024

What is the bug here? > is not required to be escaped as per XML specification, except for one very specific case: sequence ]]> is not allowed to be included unescaped. In all other cases it may or may not be escaped: this makes no difference to xml parsers. Woodstox ensures that this happens; in case of beginning of string it may not be possible to if sequence ']]' was output prior to write call (since it is legal to call writeCharacters() multiple times); in latter case content can be checked to see if there is need.

from woodstox.

arisjramos avatar arisjramos commented on May 29, 2024

You are right, I tested with jdk and it escaped all the '>' chars it misleaded my jugement.,
It is true that '>' is a legal character but the specification strongly recommends to escape it.... sorry

from woodstox.

cowtowncoder avatar cowtowncoder commented on May 29, 2024

No bug to fix here. I don't recall strong recommendation, and while I understand some users might prefer such behavior I don't have much interest in changing behavior here.

Not... there is a way to change escape settings, by registering TextEscaper (via EscapingWriterFacotry):

http://fasterxml.github.io/woodstox/javadoc/5.0/com/ctc/wstx/api/WriterConfig.html#setTextEscaperFactory(org.codehaus.stax2.io.EscapingWriterFactory)

I didn't immediately find unit test that exercises it, but this facility does allow customizing all aspects of output. It's quite a bit of work but possible to make work.

from woodstox.

cowtowncoder avatar cowtowncoder commented on May 29, 2024

Actually, configuration property is briefly covered here:

https://medium.com/@cowtowncoder/configuring-woodstox-xml-parser-stax2-properties-c80ef5a32ef1

but funnily enough there's no unit test for it. I think I might want to write one... I must have verified its functioning somehow since I wrote the feature :)

from woodstox.

cowtowncoder avatar cowtowncoder commented on May 29, 2024

And here are rudimentary tests that show usage:

393597c

from woodstox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.