OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Test for an optional XML element in an orchestration...

[ Lists Home | Date Index | Thread Index ]

[tariq abdur-rahim]
>
> Is it possible to test for an optional XML element in
> an orchestration?
>
> If you have an orchestration with a decision, you can
> test for various values of elements in an incoming
> XML document. You can even test if an element
> is null "not isnull()".
>
> However, how can you test if an optional item exists
> in an incoming document?  If you try to expose the
> field ( so you can see it on the data page for example
> ) it provokes an error as the document
> comes in.
>
>

It depends on how you are doing it, after all.  With an xslt stylesheet,
it's easy - you get nothing if the element does not exist.  With SAX, no
handler for the element gets called.  With DOM you can ask for an element by
name(getElementsByTagName() or getElementsByTagName NS(), which return node
lists, possibly empty).  Or, with whatever your current approach is, you can
use a try/except structure to avoid error exits.

Tom P





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS