header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Cmdet dev newbie
Last Post 18 Nov 2008 07:47 AM by Oisin Grehan. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
jamietUser is Offline
New Member
New Member
Posts:12
Avatar

--
22 Oct 2008 09:39 AM

    Hi,

    I'm developing my first cmdlet and coming up against a problem which isn't really anything to do with Powershell per se but nevertheless hopefully someone here can help.

     

    I have an XML document that looks something like this:


     
       

    Some summary
        Publisher B
     

     
        My first book
        Author A
      

    As you can it has 2 books in it but they both have different properties. i.e. There is no known schema here. I've been trying to use LINQ To XML to convert this into something that WriteObject() will be able to output to the pipeline. So basically I want to output 2 rows of data, 1 for each book. Can anyone come up with a way of doing that?

    I fear its not possible because I don't know beforehand what properties each book will have, there isn't even a finite list of properties that each book MIGHT have so C# being a staticly typed language can't handle it.

    Any help would be much appreciated.

     

    -jamie

    Oisin GrehanUser is Offline
    New Member
    New Member
    Posts:6
    Avatar

    --
    18 Nov 2008 07:47 AM

    Hi Jamie,

    IF you could post a workable portion of the XML source, and a better description of what youd like to see output, people could probably help you better.

    Thanks

    -Oisin

    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer