473,513 Members | 3,317 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

New to XSLT

I'm new to the whole XML / XSL tech, I've used XML w/ ado recordsets
before and have had no issues but never needed to transfer files
between systems. Now w/ Sql Server I need to import a large XML doc
but I'm having difficulty with the tags, here is a snapshot of what I'm
working with:

I want to take this:
<root>
<Schema name="Schema3" xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="tblnewproducts" content="eltOnly" model="closed"
order="many">
<element type="TAG"/>
<element type="Parent"/>
<element type="Products_x0021_1_x0021_id_x0021_Element"/>
<element type="Products_x0021_1_x0021_cat_x0021_Element"/>
<element type="Products_x0021_1_x0021_name_x0021_Element"/>
<element
type="Products_x0021_1_x0021_description_x0021_Ele ment"/>
<element type="Products_x0021_1_x0021_the_basics_x0021_Elem ent"/>
<element type="Products_x0021_1_x0021_pricing_x0021_Element "/>
<element
type="Products_x0021_1_x0021_configuration_x0021_E lement"/>
<element type="Products_x0021_1_x0021_highlights_x0021_Elem ent"/>
<element
type="Products_x0021_1_x0021_datasheettext_x0021_E lement"/>
<element
type="Products_x0021_1_x0021_linedrawingtext_x0021 _Element"/>
<element type="Products_x0021_1_x0021_presstext_x0021_Eleme nt"/>
</ElementType>
<ElementType name="TAG" content="textOnly" model="closed"
dt:type="i4"/>
<ElementType name="Parent" content="textOnly" model="closed"
dt:type="i4"/>
<ElementType name="Products_x0021_1_x0021_id_x0021_Element"
content="textOnly" model="closed" dt:type="i4"/>
<ElementType name="Products_x0021_1_x0021_cat_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType name="Products_x0021_1_x0021_name_x0021_Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType
name="Products_x0021_1_x0021_description_x0021_Ele ment"
content="textOnly" model="closed" dt:type="string"/>
<ElementType name="Products_x0021_1_x0021_the_basics_x0021_Elem ent"
content="textOnly" model="closed" dt:type="string"/>
<ElementType name="Products_x0021_1_x0021_pricing_x0021_Element "
content="textOnly" model="closed" dt:type="string"/>
<ElementType
name="Products_x0021_1_x0021_configuration_x0021_E lement"
content="textOnly" model="closed" dt:type="string"/>
<ElementType name="Products_x0021_1_x0021_highlights_x0021_Elem ent"
content="textOnly" model="closed" dt:type="string"/>
<ElementType
name="Products_x0021_1_x0021_datasheettext_x0021_E lement"
content="textOnly" model="closed" dt:type="string"/>
<ElementType
name="Products_x0021_1_x0021_linedrawingtext_x0021 _Element"
content="textOnly" model="closed" dt:type="string"/>
<ElementType name="Products_x0021_1_x0021_presstext_x0021_Eleme nt"
content="textOnly" model="closed" dt:type="string"/>
</Schema>
<tblnewproducts xmlns="x-schema:#Schema3">
<TAG>1</TAG>
<Products_x0021_1_x0021_id_x0021_Element>5</Products_x0021_1_x0021_id_x0021_Element>

<Products_x0021_1_x0021_cat_x0021_Element>Text1</Products_x0021_1_x0021_cat_x0021_Element>

<Products_x0021_1_x0021_name_x0021_Element>Text2 </Products_x0021_1_x0021_name_x0021_Element>

<Products_x0021_1_x0021_description_x0021_Element> Text3</Products_x0021_1_x0021_description_x0021_Element>

<Products_x0021_1_x0021_the_basics_x0021_Element>T ext4</Products_x0021_1_x0021_the_basics_x0021_Element>

<Products_x0021_1_x0021_pricing_x0021_Element>Text 5</Products_x0021_1_x0021_pricing_x0021_Element>

<Products_x0021_1_x0021_configuration_x0021_Elemen t>Text6</Products_x0021_1_x0021_configuration_x0021_Element >

<Products_x0021_1_x0021_highlights_x0021_Element>T est7</Products_x0021_1_x0021_highlights_x0021_Element>

<Products_x0021_1_x0021_datasheettext_x0021_Elemen t>Test8</Products_x0021_1_x0021_datasheettext_x0021_Element >

<Products_x0021_1_x0021_linedrawingtext_x0021_Elem ent>Test9</Products_x0021_1_x0021_linedrawingtext_x0021_Eleme nt>

<Products_x0021_1_x0021_presstext_x0021_Element>Te st10</Products_x0021_1_x0021_presstext_x0021_Element>
</tblnewproducts>
</root>

I want to conver the above to the following XML fragment:

<root>
<Schema name="Schema3" xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="tblnewproducts" content="eltOnly" model="closed"
order="many">
<element type="TAG"/>
<element type="Parent"/>
<element type="id"/>
<element type="cat"/>
<element type="name"/>
<element type="description"/>
<element type="the_basics"/>
<element type="pricing"/>
<element type="configuration"/>
<element type="highlights"/>
<element type="datasheettext"/>
<element type="linedrawingtext"/>
<element type="presstext"/>
</ElementType>
<ElementType name="TAG" content="textOnly" model="closed"
dt:type="i4"/>
<ElementType name="Parent" content="textOnly" model="closed"
dt:type="i4"/>
<ElementType name="id" content="textOnly" model="closed"
dt:type="i4"/>
<ElementType name="cat" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="name" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="description" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="the_basics" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="pricing" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="configuration" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="highlights" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="datasheettext" content="textOnly" model="closed"
dt:type="string"/>
<ElementType name="linedrawingtext" content="textOnly"
model="closed" dt:type="string"/>
<ElementType name="presstext" content="textOnly" model="closed"
dt:type="string"/>
</Schema>
<tblnewproducts>
<TAG>1</TAG>
<id>TEXT1</id>
<cat>TEXT2</cat>
<name>TEXT3</name>
<description>TEXT4</description>
<the_basics>TEXT5</the_basics>
<pricing>TEXT6</pricing>
<configuration>TEXT7</configuration>
<highlights>TEXT8</highlights>
<datasheettext>TEXT9</datasheettext>
<linedrawingtext>TEXT10</linedrawingtext>
<presstext>TEXT11</presstext>
</tblnewproducts>
</root>
I do not have a good concept of XSLT or a wizard to help me convert it
:)

Nov 11 '05 #1
2 1235
seeCoolGuy wrote:
I do not have a good concept of XSLT or a wizard to help me convert it
:)

So what do you want>??? that we give you the xslt source code to do that??
Hell no.
Nov 23 '05 #2
Actually information on how to begin my quest for the xslt, I've done
several google searches, but because I'm still unfamiliar w/ xslt I
thought perhaps someone has a good starting site that they'd
recommend... especially since i'm trying to conver the tag names maybe
even a site that would provide a good reference. the other route i'm
taking is to open the file via vbscript and rip out the tagnames that I
do not want and replace them w/ the ones I do. That appears to work at
the moment. I wanted to use XSL because I thought it would help me w/
future projects as well.

Tjerk Wolterink wrote:

So what do you want>??? that we give you the xslt source code to do that??
Hell no.


Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3886
by: ted | last post by:
Was wondering if XSLT alone is appropriate for the following situation. From XML, I'm creating a small website (around 50 pages) with pages that link to each other through a nav menu and a "crumb-trail" of links. I'm transforming the XML with XSLT through Saxon. The nav menu and "crumb-trail" show the user where they are within the site...
2
2774
by: Tom Corcoran | last post by:
I am working to ease updating of a html page by transforming 2 xml files. I was going to use xslt for this and had bought 2 unopened books, wrox xslt and o'reilly's xslt cookbook. But am now wondering if I am better of learning XQuery instead? Any thought and opinions would be appreciated. Cheers - Tom. The Architect: "Hope, it is the...
1
3579
by: Mohit | last post by:
Hi Friends I have to call 1 of the 2 child XSLT files from the Main XSLT file based on some criteria. I want one child XSLT file will be executed by version 1 of XSLT processor and the other by version 2 of XSLT processor based on some condition. Q) How and where shall I write logic or import desirable XSLT on the Fly ? Q) When we call...
0
2337
by: Christopher M. Lauer | last post by:
I have done my best to answer this question but can not find the proper set of commands. I would like to transform an xml file (in code behind) and display its output in a specific html tag, such as a div with a runat=server. I can somewhat do this if I create a server control and include the control within the html div tag but this...
3
2182
by: Teksure | last post by:
Hi group, searching in the Internet I found two products for XML which incorporate a very robust debugger for XSL/XSLT, I would like you to see these products and then, give me your opinion about the development environment or recommend me some other that you know. XML IDE's - http://xslt-process.sourceforge.net -...
7
2830
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID parameter to the XSLT stylesheet XsltArgumentList xsltArgList = new XsltArgumentList(); xsltArgList.AddParam("pmID", "", pmID);...
3
3071
by: Ian Roddis | last post by:
Hello, I want to embed SQL type queries within an XML data record. The XML looks something like this: <DISPLAYPAGE> <FIELD NAME="SERVER" TYPE="DROPDOWN"> <OPTION>1<OPTION> <OPTION>2<OPTION> <OPTION>3<OPTION> </FIELD>
1
2393
by: Sergey Dubinets | last post by:
In effort to prioritize our goals we composed the list of random features each of them may add value to set of XSLT tools offered from Microsoft. 1. XSLTc (Compiler for XSLT stylesheets, that generates .NET assemblies) 2. Performance improvements in the XslCompiledTransform
12
11551
by: Chris | last post by:
Hi, Just wondering if anyone out there knows if it is possible to convert a CSV to xml using XSLT? I've seen a lot of examples of xml to CSV, but is it possible to go back the other way? I don't want to have to use some external program or script to parse the csv first if possible
2
22749
jkmyoung
by: jkmyoung | last post by:
Here's a short list of useful xslt general tricks that aren't taught at w3schools. Attribute Value Template Official W3C explanation and example This is when you want to put dynamic values in the attribute of an element. Instead of using the <xsl:attribute> element, you can simply place the xpath in the attribute itself. The most...
0
7269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
5701
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4756
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.