xsl-list
[Top] [All Lists]

RE: simple xslt question, retrieved data has no xml

2006-02-01 07:33:07
Thanks for the reply; I was certainly using the wrong statement here.
Copy-of solved my problem

Lizet

_____________________________________________________________________
 Lizet Pena de Sola - ASP Web Developer
 IRON Solutions: 109 Saskatchewan Ave E. Outlook, SK Canada S0L 2N0
 Phone 1-306-867-6293 Toll-free 1-877-264-4766 Fax 1-800-665-9876
 Email lizet(_at_)ironsolutions(_dot_)com
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
-----Original Message-----
From: Hardy Merrill [mailto:HMerrill(_at_)dhcr(_dot_)state(_dot_)ny(_dot_)us] 
Sent: Monday, January 23, 2006 7:12 AM
To: lizet(_at_)ironsolutions(_dot_)com; tags.tags.
Subject: Re: [xsl] simple xslt question, retrieved data has no xml

Lizet, I'm certainly no expert and I'm just taking a wild stab at this, but
I think that when you do

  <xsl:apply-templates select="self" />

that is only going to output the text of the context node.  My guess is
that you need to do an xsl:copy or xsl:copy-of.

Hope this helps.

Hardy Merrill

lizet(_at_)ironsolutions(_dot_)com 1/22/2006 10:19 PM >>>

Hello all, 
I need to import data from a 35MB xml file into a sql server database. I'm
trying to cut that file in smaller chunks of data that can be more
manageable.
I'm using .NET framework 1.1 for this. I believe the processor is MSXML 4.0.
I can't figure out what I'm doing wrong but each time I apply an xslt to the
file I only get the text inside the nodes and I want to preserve the xml
structure of the nodes I select, in order to create smaller xml files.

Here's the code so far:

Here's the xslt file
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:fn="http://www.w3.org/2005/xpath-functions";
xmlns:xdt="http://www.w3.org/2005/xpath-datatypes";>
       <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
media-type="xml"/>
       <xsl:template match="//products[equipment/model='MX210']">
            <xsl:apply-templates select="self" />
       </xsl:template>
</xsl:stylesheet>


Dim doc2 As XmlDocument = New XmlDocument
           doc2.Load("DA880data.xml")

           ' Modify the XML file.
           Dim root As XmlElement = doc2.DocumentElement


           ' Create an XPathNavigator to use for the transform.
           Dim nav As XPathNavigator = root.CreateNavigator()

           ' Transform the file.
           Dim xslt As XslTransform = New XslTransform
           xslt.Load("transformdata.xsl")
           Dim writer As XmlTextWriter = New
XmlTextWriter("output.xml", Nothing)
           xslt.Transform(nav, Nothing, writer, Nothing)


Any idea is more than welcome. Thanks a lot for looking into this.

Lizet


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list 
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ 
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>
  • RE: simple xslt question, retrieved data has no xml, Lizet Pena de Sola <=