[xsl] Bad schemas

Subject: [xsl] Bad schemas
From: "Jeff Shevlen" <jeff@xxxxxxxxxxxxxx>
Date: Fri, 26 Jul 2002 23:51:31 -0700
Hi,

Can anyone shed some light on why Xalan parses an XML doc with no
schema no namespace (skills)differently than the identical doc
(skills2), with a schema (that is not validating properly yet), and a
namespace?

I've been punishing myself for some time trying to figure out why I
couldn't perform the simplest operations on the bad schema doc,
skills2, like stripping elements from the doc.  Is it the bad schema?
And if so how does anyone know why this affects the output the way it
does?


===SOURCE skills XML===

<skills>
 <skill category = "( technical | design | communication | managerial
| non-technical )" skillID = "---">
  <name>---</name>
  <description>---</description>
  <comment>---</comment>
  <level>( basic | intermediate | advanced )</level>
  <types>
   <type>( web programming)</type>
  </types>
  <tech_details>
   <platform>---</platform>
   <tier>---</tier>
   <versions>---</versions>
   <audiences>
    <audience>( intranet | internet | client-server)</audience>
   </audiences>
   <dev_envs>
    <dev_env>---</dev_env>
   </dev_envs>
  </tech_details>
  <years last_used = "---">---</years>
  <used_professionally>( yes | no )</used_professionally>
  <related_skills>
   <related_skill skillIDREF = "( in the same doc )"/>
  </related_skills>
 </skill>
</skills>


===SOURCE skills2 XML===

<?xml version = "1.0" encoding = "UTF-8"?>
<skills xmlns = "http://www.abc.com/skills"; xmlns:xsi =
"http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation =
"http://www.abc.com/skills
file:///C:/Documents%20and%20Settings/dang/My%20Documents/Work/xml/sch
emas/skills.xsd">

<!-- <skills>  -->
 <skill category = "( technical | design | communication | managerial
| non-technical )" skillID = "---">
  <name>---</name>
  <description>---</description>
  <comment>---</comment>
  <level>( basic | intermediate | advanced )</level>
  <types>
   <type>( web programming)</type>
  </types>
  <tech_details>
   <platform>---</platform>
   <tier>---</tier>
   <versions>---</versions>
   <audiences>
    <audience>( intranet | internet | client-server)</audience>
   </audiences>
   <dev_envs>
    <dev_env>---</dev_env>
   </dev_envs>
  </tech_details>
  <years last_used = "---">---</years>
  <used_professionally>( yes | no )</used_professionally>
  <related_skills>
   <related_skill skillIDREF = "( in the same doc )"/>
  </related_skills>
 </skill>
</skills>


===XSLT===

<?xml version = "1.0" encoding = "UTF-8"?>

<xsl:stylesheet version = "1.0" xmlns:xsl =
"http://www.w3.org/1999/XSL/Transform";>
  <xsl:output method = "xml" indent = "yes"/>


 <xsl:template match = "/">
  <xsl:apply-templates/>
 </xsl:template>

 <xsl:template match = "//related_skill">
  <xsl:element name = "test">
   <xsl:text>XXXX   </xsl:text>
    <xsl:attribute name = "skill_IDREF">
    <xsl:value-of select = "@skill_IDREF"/>
   </xsl:attribute>
  </xsl:element>
 </xsl:template>

 <xsl:template match = "skills">
 </xsl:template>

 <xsl:template match = "skill">
 </xsl:template>

 <xsl:template match = "related_skills">
 </xsl:template>

 <xsl:template match = "name">
 </xsl:template>

 <xsl:template match = "description">
 </xsl:template>

 <xsl:template match = "comment">
 </xsl:template>

 <xsl:template match = "level">
 </xsl:template>

 <xsl:template match = "types">
 </xsl:template>

 <xsl:template match = "type">
 </xsl:template>

 <xsl:template match = "tech_details">
 </xsl:template>

 <xsl:template match = "platform">
 </xsl:template>

 <xsl:template match = "tier">
 </xsl:template>

 <xsl:template match = "versions">
 </xsl:template>

 <xsl:template match = "audiences">
 </xsl:template>

 <xsl:template match = "audience">
 </xsl:template>

 <xsl:template match = "dev_envs">
 </xsl:template>

 <xsl:template match = "dev_env">
 </xsl:template>

 <xsl:template match = "years">
 </xsl:template>

 <xsl:template match = "used_professionally">
 </xsl:template>

</xsl:stylesheet>


===OUTPUT skills===

<test>XXXX   </test>




===OUTPUT skills2===

<?xml version="1.0" encoding="utf-8"?>



  ---
  ---
  ---
  ( basic | intermediate | advanced )

   ( web programming)


   ---
   ---
   ---

    ( intranet | internet | client-server)


    ---


  ---
  ( yes | no )







 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread