You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by Saliya Ekanayake <es...@gmail.com> on 2007/07/15 15:13:19 UTC

[Axiom] validate XML input

Hi all,

I'm using the following code fragment to create a builder for a stream
containing an XML input (inputBytes).

ByteArrayInputStream bais = new ByteArrayInputStream(inputBytes);
StAXOMBuilder builder = new StAXOMBuilder(bais);

I want to do attribute value normalization and entity reference resolution
(requirement in Canonical XML spec). So can somebody please help me to
understand these two concepts and to implement them with the use of Axiom.
Is there any prerequisite that I should do before writing the above two code
lines?

Thanks in advance,
Saliya

Re: [Axiom] validate XML input

Posted by Saliya Ekanayake <es...@gmail.com>.
Thanks a lot for the speedy reply. Yea, sure I'll write some code with axiom
to check this attribute value normalization.

Thanks again,
Saliya

On 7/16/07, Eran Chinthaka <ch...@opensource.lk> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Saliya Ekanayake wrote:
> > Hi all,
> >
> > I'm using the following code fragment to create a builder for a stream
> > containing an XML input (inputBytes).
> >
> > ByteArrayInputStream bais = new ByteArrayInputStream(inputBytes);
> > StAXOMBuilder builder = new StAXOMBuilder(bais);
> >
> > I want to do attribute value normalization and entity reference
> resolution
> > (requirement in Canonical XML spec).
>
> Entity reference resolution is done by the underlying parser itself. So
> u do not need to do anything for that.
>
> If you wanna know what entity references are, some of the examples are
> "<", ">", "&" etc., You can not simply include those char as texts
> within an xml. In simple terms you need to escape them. So you replace
> "<" with "&lt;" etc.
>
> Better google for them if u need more info.
>
> But I am not sure whether XMLStreamWriter does attribute value
> normalization. There is one way you can know it for sure ;) Writer some
> code either using pure StAX api or using Axiom to serialize some
> normalizable attribute values.
>
> HTH.
> Chinthaka
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGmrscjON2uBzUhh8RAiNsAJ0eS/gfYc++ZBJwR9WaV68micya+QCghxyC
> Vfml4wvCq9/Mgoyfq9PMBIw=
> =5Va5
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: commons-dev-help@ws.apache.org
>
>


-- 
Saliya Ekanayake
http://www.esaliya.blogspot.com
http://www.esaliya.wordpress.com

Re: [Axiom] validate XML input

Posted by Eran Chinthaka <ch...@opensource.lk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Saliya Ekanayake wrote:
> Hi all,
> 
> I'm using the following code fragment to create a builder for a stream
> containing an XML input (inputBytes).
> 
> ByteArrayInputStream bais = new ByteArrayInputStream(inputBytes);
> StAXOMBuilder builder = new StAXOMBuilder(bais);
> 
> I want to do attribute value normalization and entity reference resolution
> (requirement in Canonical XML spec). 

Entity reference resolution is done by the underlying parser itself. So
u do not need to do anything for that.

If you wanna know what entity references are, some of the examples are
"<", ">", "&" etc., You can not simply include those char as texts
within an xml. In simple terms you need to escape them. So you replace
"<" with "&lt;" etc.

Better google for them if u need more info.

But I am not sure whether XMLStreamWriter does attribute value
normalization. There is one way you can know it for sure ;) Writer some
code either using pure StAX api or using Axiom to serialize some
normalizable attribute values.

HTH.
Chinthaka
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGmrscjON2uBzUhh8RAiNsAJ0eS/gfYc++ZBJwR9WaV68micya+QCghxyC
Vfml4wvCq9/Mgoyfq9PMBIw=
=5Va5
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org