Altova Mailing List Archives


[xsl] separating elements/attributes

From: Samina Islam <samnaz123@--------->
To:
Date: 8/21/2001 9:14:00 AM
Hi All!

I have this XML document that I am processing through
a XSL stylesheet.  (trying to convert it into PRISM). 
Some of the elements I'm using directly and some I'm
not using.  

My XML document looks like this:
...
<moreovernews>
 <article id="_23174907">
   <url>http://c.moreover.com</url> 
   <headline>Alcoa</headline> 
   <source>Washington Post</source> 
   <media_type>text</media_type> 
   <cluster>moreover...</cluster> 
   <tagline /> 
   <doc_url>http://washingtonpost.com/</doc_url> 
   <time>Aug 11 2001 11:07PM</time> 
   <access_reg /> 
   <access_status /> 
 </article>
...

In my XSL I'm using some of these elements.  this is
part of my stylesheet:

...
<xsl:template match="/*">
  <rdf:RDF>
    <xsl:apply-templates select="article"/>
  </rdf:RDF>
</xsl:template>
		
<xsl:template match="article">
 <rdf:Description> <xsl:attribute 
                    name="rdf:about"><xsl:value-of 
                    select="url"/></xsl:attribute>
   <dc:identifier><xsl:value-of  
      select='@id'/></dc:identifier>
   <dc:title><xsl:value-of 
      select="headline_text"/></dc:title>
   <dc:publisher><xsl:value-of 
      select="source"/></dc:publisher>
   <dc:source><xsl:value-of 
      select="document_url"/></dc:source>    
 </rdf:Description>
</xsl:template>
...


Now for all the "unused" elements/attributes, I want
to do something like this in my stylesheet:

<moreover:tagline><xsl:value-of
      select="tagline"/></moreover:tagline>
<moreover:access_reg><xsl:value-of 
      select="access_reg"/></moreover:access_reg>
<moreover:access_status><xsl:value-of 
     
select="access_status"/></moreover:access_status>

... and so on for thoses I haven't specifically called
before.  

I know that I can write out each of these out (like i
did above), but is there some way of doing this w/out
specially using the names "tagline, access_reg, etc"? 
for all the "unused" elements I just want to put them
into a namespace called moreover.  

I hope that was clear.  

thanks!

Samina


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.