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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Validation or Transformation: Either or Both

[ Lists Home | Date Index | Thread Index ]
  • From: "Bullard, Claude L (Len)" <clbullar@ingr.com>
  • To: xml-dev@lists.xml.org
  • Date: Wed, 06 Dec 2000 09:41:57 -0600

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




 

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

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