This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
separating elements/attributes
- To: XSL-List at lists dot mulberrytech dot com
- Subject: [xsl] separating elements/attributes
- From: Samina Islam <samnaz123 at yahoo dot com>
- Date: Tue, 21 Aug 2001 10:05:04 -0700 (PDT)
- Reply-To: xsl-list at lists dot mulberrytech dot com
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