On Thu, 2003-11-27 at 12:15, Stefan Bodewig wrote: > Hi, > > I've just added a utility class to CVS HEAD that can be used to turn > nested content into a DOMFragment (not necessarily a tree). I.e., if > you use it as your nested element like > > public void addContext(XMLFragment f) > > you can get the DOMFragment corresponding to the structure nested into > <content> from > > <content> > <some-element>with nested text</some-element> > <and-another-one with="parameters"/> > </content> > > via f.getFragment() Pretty cool. > > Dominique has posted similar code here and on the user list a couple > of times and Upayavira needed something like this for his cocoon Ant > task. I will need it for my <nant> and <msbuild> sandbox tasks. > > Some notes: > > * it doesn't deal very well with mixed content - but this is a general > problem of all Ant elements. This is something that we should look at in the 1.7 timeframe. > > * Namespace support is not complete. Peter, correct me if I'm wrong. > I can get the namespace URI and the local name, but I can't get > access to the prefix actually used on the elements when I use the > DynamicConfigurator interface.
This is correct, the prefix is only known at parse time. I was thinking of retaining the prefix and storing it in the corresponding UnknownElement - but never got around to doing this. When this is done, we could provide a namespace-aware DynamicConfigurator interface. Peter > > Right now I don't parse the name at all, it may be better to extract > the namespace URI and the local name (currently commented out in the > committed code) instead. > > * I've put it into the util package. types would be an alternative. > > * Even though I'll have to copy it into my dotnet antlib sandbox if I > want to use it and Ant 1.6 together, I'd still prefer to keep it > outside of the 1.6 branch in order to not push too many things into > 1.6 anymore. > > Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]