This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Microsoft XML > August 2006 > Conditional Transformation-Display
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Conditional Transformation-Display
|
|
| RSmith 2006-08-17, 6:43 pm |
| I have a 15mb XML file with data I need to extract.
Partial Sample:
*********************
<?xml version="1.0" encoding="utf-8"?>
<apps >
<app>
<rths>
<rth stuff="a" status="ac" id="2">
<name>SomeName</name>
<description>SomeDescription.</description>
<references>
<cveids>
<cveid stuff="SOME STUFF"</cveid>
</cveids>
</references>
</rth>
</rths>
</app>
</apps>
*****************
I can transform the XML to display the fields I need in bold,itacics,etc.,
but what I want to do is display ONLY certain fields and leave the rest
"invisible". Or export out only those fields I need. I have been trying to do
this with XSL, maybe I am approaching this wrong.
Sample XSL:
*********************************
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="name">
<P><I><xsl:apply-templates/></I></P>
</xsl:template>
<xsl:template match="cveids">
<B><xsl:apply-templates/></B>
</xsl:template>
</xsl:stylesheet>
*********************************
I was going to display the data in a browser and then cut and paste it into
an excel spread sheet and that will be good enough if it is possible.
Any help will be appreciated.
| |
| Dimitre Novatchev 2006-08-17, 10:35 pm |
| Read about "identity rule" or "identity template".
By overriding the identity template with more specific rules one can easily
perform a great variety of tasks such as removing certain nodes, copying
certain nodes, renaming certain nodes, any combination of these, ..., etc.
Cheers,
Dimitre Novatchev
"RSmith" <RSmith@discussions.microsoft.com> wrote in message
news:C129B4A2-1AAC-4600-9264-B44E758E8487@microsoft.com...
>I have a 15mb XML file with data I need to extract.
> Partial Sample:
> *********************
> <?xml version="1.0" encoding="utf-8"?>
> <apps >
> <app>
> <rths>
> <rth stuff="a" status="ac" id="2">
> <name>SomeName</name>
> <description>SomeDescription.</description>
> <references>
> <cveids>
> <cveid stuff="SOME STUFF"</cveid>
> </cveids>
> </references>
> </rth>
> </rths>
> </app>
> </apps>
> *****************
> I can transform the XML to display the fields I need in bold,itacics,etc.,
> but what I want to do is display ONLY certain fields and leave the rest
> "invisible". Or export out only those fields I need. I have been trying to
> do
> this with XSL, maybe I am approaching this wrong.
> Sample XSL:
> *********************************
> <?xml version='1.0'?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:template match="name">
> <P><I><xsl:apply-templates/></I></P>
> </xsl:template>
> <xsl:template match="cveids">
> <B><xsl:apply-templates/></B>
> </xsl:template>
> </xsl:stylesheet>
> *********************************
> I was going to display the data in a browser and then cut and paste it
> into
> an excel spread sheet and that will be good enough if it is possible.
> Any help will be appreciated.
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|