[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Validation or Transformation: Either or Both
Is it the case that one can have type validation (per schema, in this case, XDR) or transformation but not both? An XML instance has a default namespace assigned to enable validation in MSXML 3.0, latest release. The fragment is: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="inbound2.xsl" ?> <ips_cad xmlns:cad="x-schema://davidg/XML/Schemas/CadSchema.xml" sequenceNumber="1" documentContent="event" requestDateTime="2000-08-14T15:43:13-05:00" requestTerminal="davidg" requestPerson="123"> <event> <eventID>152634</eventID> <caller> <callerPhone>1234567890</callerPhone> and for validation, this works. However, a stylesheet is created. The fragment is: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cad="x-schema://davidg/XML/Schemas/CadSchema.xml" > <xsl:output method="xml" indent="yes" standalone="yes" /> <xsl:template match="/"> <xsl:element name="ips_cad"> <xsl:attribute name="sequenceNumber"><xsl:value-of select="/cad:ips_cad/@sequenceNumber"/></xsl:attribute> <xsl:attribute name="documentContent"><xsl:value-of select="/cad:ips_cad/@documentContent"/></xsl:attribute> <xsl:attribute name="requestDateTime"><xsl:value-of select="/cad:ips_cad/@requestDateTime"/></xsl:attribute> <xsl:attribute name="requestTerminal"><xsl:value-of select="/cad:ips_cad/@requestTerminal"/></xsl:attribute> <xsl:attribute name="requestPerson"><xsl:value-of select="/cad:ips_cad/@requestPerson"/></xsl:attribute> </xsl:element> <event> <xsl:copy-of select="/cad:ips_cad/event/eventID"/> <caller> <xsl:copy-of select="/cad:ips_cad/event/caller/callerName"/> If the transform is applied with the XML instance default namespace intact, only the xsl:element finds the values and inserts them. I have tried several combinations of namespace declaration and prefix usage, but I haven't found the right one that enables me to transform and validate the instance. I have looked at Jeni Tennison's examples in the archive. I understand that removing the default in the instance enables transformation, but then what about validation? Thanks. Len http://www.mp3.com/LenBullard Ekam sat.h, Vipraah bahudhaa vadanti. Daamyata. Datta. Dayadhvam.h
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|