User Profile

Collapse

Profile Sidebar

Collapse
pisicuta
pisicuta
Last Activity: Mar 7 '10, 10:46 PM
Joined: Oct 28 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • pisicuta
    replied to XML sorting
    in XML
    Solution

    I managed to get the answer from somewhere else. For all those interested, here it is.

    Code:
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
      <xsl:template match="Building">
        <xsl:copy>
          <xsl:copy-of select="@*" /> <!-- copy attributes-->
          <xsl:apply-templates
    ...
    See more | Go to post
    Last edited by Dormilich; Feb 23 '10, 06:29 AM. Reason: Please use [code] tags when posting code

    Leave a comment:


  • pisicuta
    replied to XML sorting
    in XML
    Spent all day with Munchian sorting and am no further forward. In fact I've probably got a bigger headache. I just can't get any elements copied from the <Piece>..</Piece> nodes and have the Block details as well. I end up with:

    Code:
    <Building>
    	<Block>
    		<Id>Ba2150</Id>
    		<Elevation>140</Elevation>
                    <Piece />
    		<Piece />
    ...
    See more | Go to post
    Last edited by Dormilich; Feb 19 '10, 10:49 PM. Reason: Please use [code] tags when posting code

    Leave a comment:


  • pisicuta
    replied to XML sorting
    in XML
    Sorry, I didn't it clear what the output should be. The output should look like this, so the Piece elements are in ascending elevation order:

    Code:
    <?xml version="1.0"?>
    <Building>
    	<Block>
    		<Id>Ba2150</Id>
    		<Elevation>140</Elevation>
    		<Piece>
    			<Description>Side</Description>
    			<Elevation>140</Elevation>
    ...
    See more | Go to post
    Last edited by Dormilich; Feb 19 '10, 08:02 AM. Reason: Please use [code] tags when posting code

    Leave a comment:


  • pisicuta
    started a topic XML sorting
    in XML

    XML sorting

    People must get sick of answering questions on sorting, but I haven't found an example on the web that matches my situation (Maybe I am asking the wrong question). My XML file has this sort of structure
    Code:
    <?xml version="1.0"?>
    <Building>
    	<Block>
    		<Id>Ba2150</Id>
    		<Elevation>140</Elevation>
    		<Piece>
    			<Description>Rustic</Description>
    ...
    See more | Go to post
    Last edited by Dormilich; Feb 19 '10, 05:15 AM. Reason: Please use [code] tags when posting code

  • pisicuta
    replied to Extracting more than one attribute value
    in XML
    Thanks again for your time
    See more | Go to post

    Leave a comment:


  • pisicuta
    replied to Extracting more than one attribute value
    in XML
    Thanks Dormilich. What is the XPath approach to my problem?
    See more | Go to post

    Leave a comment:


  • pisicuta
    replied to Extracting more than one attribute value
    in XML
    In the real file there are 34 attributes in the Stuff element. I only want some of them extracted. The parent Id is the is Id other elements in the file that also have to have the same attributes extracted. I suppose my question should have been How do I extract multiple attributes from an Element using Linq? At the moment I think it is the most favourable way for my application.
    See more | Go to post

    Leave a comment:


  • pisicuta
    started a topic Extracting more than one attribute value
    in XML

    Extracting more than one attribute value

    I have an XML file that looks something like this
    Code:
    <MyXML>
    	<Stuff IDX="1"  Name="Swish" Manufacturer="Grimoto" ParentRef = "0" Ref = "1234567" />
    	: More elements
    	: More elements
    		<Stuff IDX="0"  Name="Swosh" Manufacturer="Grimoto" ParentRef = 1234567" Ref = "9876543" />
    		: More elements
    ...
    See more | Go to post
    Last edited by Dormilich; Oct 28 '09, 11:33 AM. Reason: Please use [code] tags when posting code
No activity results to display
Show More
Working...