[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Validation or Transformation: Either or Both

  • From: "Bullard, Claude L (Len)" <clbullar@i...>
  • To: xml-dev@l...
  • Date: Wed, 06 Dec 2000 09:41:57 -0600

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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.