You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ecs-user@jakarta.apache.org by ot...@ivillage.com on 2001/10/10 17:21:45 UTC

3 basic ECS questions

Hello,

I am thinking about using ECS to help me piece some XML together and I have a few basic questions:

1. The schema for the XML that I need to create has its own elements (e.g. <Parent>, <Child>). ECS does not support that, of course. I would have to write something like:

XML parentElem = new XML("Parent");
parentElem.addElement("Child");
So my question is: What does using ECS like this get me?  What is the advantage of this over, say, appending to a StringBuffer?
Is it less error prone?  Is it more efficient?  Does it result in a cleaner code?
Please don't take this question wrong, I just want to make the right decision, and for that I need to understand ECS better.

2. Is there any documentation about ECS other than the API javadocs?
http://jakarta.apache.org/ecs/ doesn't have much info.

3. I checked the mailing list archive and found mentions of ECS2, the rewrite.  I then checked its CVS repository in which most of the code was several months old.
So I am wondering what the status of ECS2 is?  Again, I just want to make the best decision, so I need to know whether I should go with ECS 1.4.1 or if it makes sense to wait for ECS2.

3. This is related to question #1 above.
Is the above code example the best way to create XML with custom elements?
Is there a way to extend certain (Element?) classes with a minimum amount of code and end up with better (cleaner, more elegant, more efficient, maintainable, flexible) code?
If this is the way to go, does anyone have an example?


Thank you,
Otis

_________________________________________________________________
iVillage.com: Solutions for Your Life 
Check out the most exciting women's community on the Web   
http://www.ivillage.com

---------------------------------------------------------------------
To unsubscribe, e-mail: ecs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-user-help@jakarta.apache.org


Re: 3 basic ECS questions

Posted by Yuji Kumasaka <ku...@mms.intec.co.jp>.
Hi,

On 10 Oct 2001 08:21:45 -0700
otisg@ivillage.com wrote:

> 2. Is there any documentation about ECS other than the API javadocs?
> http://jakarta.apache.org/ecs/ doesn't have much info.

You can find a nice document for ECS on search engine google.

http://www.google.com/

and use following one key word (inclusive underscore)

generating_html_with_ecs

If that original page does not access, 
you can use cash on google.


-- 
Yuji Kumasaka <ku...@mms.intec.co.jp>


---------------------------------------------------------------------
To unsubscribe, e-mail: ecs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-user-help@jakarta.apache.org


Re: 3 basic ECS questions

Posted by robert burrell donkin <ro...@mac.com>.
On Wednesday, October 10, 2001, at 04:21 PM, otisg@ivillage.com wrote:

> Hello,
>
> I am thinking about using ECS to help me piece some XML together and I 
> have a few basic questions:
>
> 1. The schema for the XML that I need to create has its own elements (e.g.
>  <Parent>, <Child>). ECS does not support that, of course. I would have 
> to write something like:
>
> XML parentElem = new XML("Parent");
> parentElem.addElement("Child");
> So my question is: What does using ECS like this get me?  What is the 
> advantage of this over, say, appending to a StringBuffer?
> Is it less error prone?  Is it more efficient?  Does it result in a 
> cleaner code?
> Please don't take this question wrong, I just want to make the right 
> decision, and for that I need to understand ECS better.

the standard way to do this kind of thing is with a DOM implementation 
(rather than a string buffer). AFAIK the ecs (1) xml stuff is an 
improvement (quicker with easier syntax) over general DOM implementations.
  unfortunately neither offer strong typing of attributes or elements and 
so are only a little better than appending to a string buffer. (well 
spotted :)
you can get hold of specific DOM implementations for common document types 
and similarly you can use ecs implementations for writing (for example) 
xhtml. these are better (less error prone and more efficient).

> 2. Is there any documentation about ECS other than the API javadocs?
> http://jakarta.apache.org/ecs/ doesn't have much info.

that's about it, it think.

> 3. I checked the mailing list archive and found mentions of ECS2, the 
> rewrite.  I then checked its CVS repository in which most of the code was 
> several months old.
> So I am wondering what the status of ECS2 is?  Again, I just want to make 
> the best decision, so I need to know whether I should go with ECS 1.4.1 
> or if it makes sense to wait for ECS2.

the newer stuff's in the generation folder :)
the plan is to generate as much as possible from xml-schema. it doesn't 
make much sense to commit generated classes until we have a final 
generated version. then we'll set about hand changes.
if you want to take a look at the newer stuff, you'll need to generate 
locally.

> 3. This is related to question #1 above.
> Is the above code example the best way to create XML with custom elements?
> Is there a way to extend certain (Element?) classes with a minimum amount 
> of code and end up with better (cleaner, more elegant, more efficient, 
> maintainable, flexible) code?

if you don't mind playing about with unreleased code, you might like to 
try generating a set of ecs writing classes for your document type. (these 
are a strongly typed object model for your xml.) i have code (somewhere) 
that generates a specfic DOM implementation for an xml-schema but i think 
that ecs2's architecture is *much* easier to use - plus it's quicker and 
smaller - since it is designed *only* to write (DOM implementations need 
to be able to be used by a parser as well).

> If this is the way to go, does anyone have an example?

the xhtml schema is the example we're using to get the ecs2 templates 
correct before rolling out.
if you want to give the generated ecs2 writing classes a try then post a 
reply and i'll give you directions. you'll need either an xml-schema or a 
DTD (xerces will create a schema from a DTD).

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: ecs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-user-help@jakarta.apache.org