From: Arne Vajhøj on
On 05-05-2010 04:03, bugbear wrote:
> Arne Vajh�j wrote:
>> Besides the already stated about using return value and literal,
>> then I will say that you should consider using one of Java's many
>> XML libraries instead of using regex to manipulate XML with.
>
> Agreed. It's sad that XML, the touted "simple" replacement/successor
> to SGML became so complicated that a library (and a large one!) is
> needed, but it is.

XML is not a replacement for SGML. XML is a form of SGML.

And I do not see the benefits of an existing library as
an indication of a problem. It is natural to reuse code.

I do agree that XML has become rather complex. There are
some "design by committee" signs in it. DTD is much simpler
than schemas. Sure schemas can provide more information, but
is it really needed.

Arne

From: Arne Vajhøj on
On 05-05-2010 05:13, RedGrittyBrick wrote:
> On 05/05/2010 09:03, bugbear wrote:
>> Arne Vajhøj wrote:
>>> you should consider using one of Java's many XML libraries instead
>>> of using regex to manipulate XML with.
>>
>> Agreed. It's sad that XML, the touted "simple" replacement/successor
>> to SGML became so complicated that a library (and a large one!) is
>> needed, but it is.
>
> Amen.
>
> Actually several large libraries. Choosing between them is a problem in
> itself, at least for newbies.

One has to evaluate whether the benefits outweigh the cost of
the extra complexity.

I think JAXB and StAX was worth it.

Arne

From: Arne Vajhøj on
On 05-05-2010 14:24, Mike Amling wrote:
> bugbear wrote:
>> Arne Vajh�j wrote:
>>> On 04-05-2010 08:44, gwoodhouse(a)gmail.com wrote:
>>
>>> Besides the already stated about using return value and literal,
>>> then I will say that you should consider using one of Java's many
>>> XML libraries instead of using regex to manipulate XML with.
>>
>> Agreed. It's sad that XML, the touted "simple" replacement/successor
>> to SGML became so complicated that a library (and a large one!) is
>> needed, but it is.
>
> Yep. That's why I wrote my own implementations of an XML parser,
> formatter and validator (DSD), years ago. I got tired of shipping two
> giant jar files that served no other purpose. It was worth the effort
> just to get the ability to use DSD validation rather than XML Schema.

Given that XML parser has required no extra jar files since
Java 1.4 released in 2002, then that argument has not much
validity today.

Arne
From: Lew on
Arne Vajhøj wrote:
>>>> you should consider using one of Java's many XML libraries instead
>>>> of using regex to manipulate XML with.

bugbear wrote:
>>> Agreed. It's sad that XML, the touted "simple" replacement/successor
>>> to SGML became so complicated that a library (and a large one!) is
>>> needed, but it is.

RedGrittyBrick wrote:
>> Amen.
>>
>> Actually several large libraries. Choosing between them is a problem in
>> itself, at least for newbies.

Arne Vajhøj wrote:
> One has to evaluate whether the benefits outweigh the cost of
> the extra complexity.
>
> I think JAXB and StAX was worth it.

Even SAX, and occasionally one of the DOMs.

JAXB is especially painless.

--
Lew
From: Lew on
Arne Vajhøj wrote:
> DTD is much simpler
> than schemas. Sure schemas can provide more information, but
> is it really needed.

Yes.

--
Lew