[XML-SIG] Advice On Testing With XML
tennis at tripit.com
Thu Jul 9 21:06:38 CEST 2009
I'm looking for some guidence in handling a testing issue. I'm new to
XML/XSLT, so please bear with me.
First, a little background. My charter is to generate XML test messages to
make sure we process them correctly. These messages are validated against a
schema. I'm using generateDS to generate the test messages. This ensures
the xml is correct.
Everything works great except for one problem that keeps cropping up. Some
elements cannot be defined easily ahead of time when generating the final
For example, a field of type "xs:date" will have to be modifed because tests
are based on a relative date, not an absolute one. That is, dates in tests
are based on things like "3 days before today".
Therefore, I'd like to figure out some way to change certain fields like
date so that I can pass a string and _still validate_ it against the
schema. Using the example, "-3" would be passed in the date field so that
the test harness will recognize it as "today - 3 days".
Put another way, the goal is to make this:
* <xs:element maxOccurs="1" minOccurs="0" name="date" type="xs:date"/>*
...behave like this:
*<xs:element maxOccurs="1" minOccurs="0" name="date" type="xs:string"/>*
Naturally, I can edit and copy/paste into a completely new schema file. But
I was hoping someone could tell me if I can do some kind of XSLT or whatever
to get the same effect.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the XML-SIG