DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Need help with XSLT

  1. #1
    Join Date
    Dec 2006
    Posts
    16

    Need help with XSLT

    Hello,
    Can someone please help me with the following scenario?

    I have a scenario as follows:

    1. A dataset having table A with foll columns. At runtime data is fetched from sql

    Emp Id Emp Name Address
    1 aaa xxx
    2 bbb yyy
    3 ccc zzz

    2. Now I need to convert this to xml :
    <Employee>
    <EmpId>1</EmpId>
    <EmpName>aaa</EmpName>
    <EmpAddress>xxx</EmpAddress>
    <Subordinate>
    <SubEmpId>1</SubEmpId>
    <SubEmpName>aaa</SubEmpName>
    <SubEmpAddress>xxx</SubEmpAddress>
    </Subordinate>
    </Employee>

    I need help with the xslt. I am using .Net 2005

    Thank you

  2. #2
    Join Date
    Apr 2007
    Posts
    15
    You're thinking of it backwards - XSLT is used for converting XML to other formats, not vice-versa. If the input isn't XML, then XSLT won't really know what to do with it.

    That's the case with XSLT 1.0, anyway. There's ways to do this in XSLT 2.0, but unless you have to worry about encodings and non-Unicode characters, you're much better off just using a regular expression to create the XML, and then using XSLT to work with your XML data from there on out.

Similar Threads

  1. Problem applying simple XSLT to XML
    By gregclark in forum XML
    Replies: 3
    Last Post: 08-26-2005, 05:07 AM
  2. Replies: 2
    Last Post: 05-04-2002, 02:50 AM
  3. Importing xslt into 1 master xslt then to html
    By Patrick Long in forum XML
    Replies: 1
    Last Post: 03-01-2002, 03:47 PM
  4. Replies: 0
    Last Post: 06-21-2001, 05:33 PM
  5. Multiple stylesheets with XSLT
    By Mark in forum XML
    Replies: 0
    Last Post: 04-10-2001, 05:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center