Windows Vista Forums

XML with Item tags

  1. #1


    public news groups Guest

    XML with Item tags

    I meant to create a generic XML document to illustrate but had this Feeds
    API example handy.

    I've been playing with the Feeds API via "Microsoft.FeedsManager" and I find
    that I am having trouble when I get the XML of a FeedItem.

    >$feeds = (New-Object -com "Microsoft.FeedsManager").RootFolder.Feeds
    >$feeds|%{$_.Items}|%{[XML]($_.xml(1))}

    format-default : The member "Item" is already present.



    The following gets me a bit more information.

    >$feeds|%{$_.Items}|%{[XML]($_.xml(1))}|gm

    The pipeline has been stopped.
    At line:1 char:34
    + $Feeds|%{$_.Items}|%{[XML]($_.xml( <<<< 1))}|gm
    The pipeline has been stopped.
    At line:1 char:13
    + $Feeds|%{$_.I <<<< tems}|%{[XML]($_.xml(1))}|gm
    Get-Member : The member "Item" is already present.
    At line:1 char:41
    + $Feeds|%{$_.Items}|%{[XML]($_.xml(1))}|gm <<<<

    It seems there is a ParameterizedProperty "Item" interfering with the
    Property "Item".

    Anyone have a hint at overcoming this?



      My System SpecsSystem Spec

  2. #2


    dreeschkind Guest

    RE: XML with Item tags

    I get the same strange results. Looks like a Format-Default has a problem.
    However, you can still work with the XML object:

    $feeds|%{$_.Items} | % { ([xml]$_.xml(1)).item.link }

    --
    greetings
    dreeschkind

    "public news groups" wrote:

    > I meant to create a generic XML document to illustrate but had this Feeds
    > API example handy.
    >
    > I've been playing with the Feeds API via "Microsoft.FeedsManager" and I find
    > that I am having trouble when I get the XML of a FeedItem.
    >
    > >$feeds = (New-Object -com "Microsoft.FeedsManager").RootFolder.Feeds
    > >$feeds|%{$_.Items}|%{[XML]($_.xml(1))}

    > format-default : The member "Item" is already present.
    >
    > The following gets me a bit more information.
    >
    > >$feeds|%{$_.Items}|%{[XML]($_.xml(1))}|gm

    > The pipeline has been stopped.
    > At line:1 char:34
    > + $Feeds|%{$_.Items}|%{[XML]($_.xml( <<<< 1))}|gm
    > The pipeline has been stopped.
    > At line:1 char:13
    > + $Feeds|%{$_.I <<<< tems}|%{[XML]($_.xml(1))}|gm
    > Get-Member : The member "Item" is already present.
    > At line:1 char:41
    > + $Feeds|%{$_.Items}|%{[XML]($_.xml(1))}|gm <<<<
    >
    > It seems there is a ParameterizedProperty "Item" interfering with the
    > Property "Item".
    >
    > Anyone have a hint at overcoming this?
    >
    >
    >


      My System SpecsSystem Spec

  3. #3


    public news groups Guest

    Re: XML with Item tags

    > However, you can still work with the XML object:
    >
    > $feeds|%{$_.Items} | % { ([xml]$_.xml(1)).item.link }



    Yes sir. I knew I could. Hard to do if you want to discover the shape of the
    xml with get-member.

    The problem remains even if you do not use Format-Default.

    >$Feeds|%{$_.Items}|%{$b=[XML]($_.xml(1));$b}|gm


    This might be a BUG in pipeline processing. Any other thoughts?



      My System SpecsSystem Spec

  4. #4


    dreeschkind Guest

    Re: XML with Item tags

    "public news groups" wrote:

    > This might be a BUG in pipeline processing. Any other thoughts?


    As you mentioned in your first post, this has something to do with the Item
    property.
    I agree that this bug affects the discoverability of the XML document
    structure.
    These two (ugly) workarounds are all that I can come up with at the moment:

    $feeds|%{$_.Items} | % {([xml]$('<root>'+$_.xml(1)+'</root>')).root.Item}

    $feeds|%{$_.Items} | % {
    ([xml]$_.xml(1).replace("<item","<psitem").replace("</item>","</psitem>")).psitem}

    --
    greetings
    dreeschkind

      My System SpecsSystem Spec

  5. #5


    public news groups Guest

    Re: XML with Item tags


    "dreeschkind" wrote

    > These two (ugly) workarounds are all that I can come up with at the
    > moment:
    >
    > $feeds|%{$_.Items} | % {([xml]$('<root>'+$_.xml(1)+'</root>')).root.Item}
    >
    > $feeds|%{$_.Items} | % {
    > ([xml]$_.xml(1).replace("<item","<psitem").replace("</item>","</psitem>")).psitem}



    Thank you sir. I will do a bit more testing over a few more Xml objects
    before I report a bug.



      My System SpecsSystem Spec

  6. #6


    Keith Hill [MVP] Guest

    Re: XML with Item tags

    "public news groups" <null@nil.no> wrote in message
    news:%23f0bPigAHHA.3316@TK2MSFTNGP02.phx.gbl...
    >
    > "dreeschkind" wrote
    >
    >> These two (ugly) workarounds are all that I can come up with at the
    >> moment:
    >>
    >> $feeds|%{$_.Items} | % {([xml]$('<root>'+$_.xml(1)+'</root>')).root.Item}
    >>
    >> $feeds|%{$_.Items} | % {
    >> ([xml]$_.xml(1).replace("<item","<psitem").replace("</item>","</psitem>")).psitem}

    >
    >
    > Thank you sir. I will do a bit more testing over a few more Xml objects
    > before I report a bug.


    When you report it, post the Connect link here so when can vote on it. I've
    run into this one before and it is annoying.

    --
    Keith



      My System SpecsSystem Spec

  7. #7


    public news groups Guest

    Re: XML with Item tags

    A link to a bug report on this issue is at connect if anyone would like to
    review and/or vote on it.

    https://connect.microsoft.com/feedba...6697&SiteID=99



    "Keith Hill [MVP]" wrote in message

    > When you report it, post the Connect link here so when can vote on it.
    > I've run into this one before and it is annoying.




      My System SpecsSystem Spec

  8. #8


    Keith Hill [MVP] Guest

    Re: XML with Item tags

    "public news groups" <null@nil.no> wrote in message
    news:%23NokyO3AHHA.2276@TK2MSFTNGP03.phx.gbl...
    >A link to a bug report on this issue is at connect if anyone would like to
    >review and/or vote on it.
    >
    > https://connect.microsoft.com/feedba...6697&SiteID=99


    Voted. Thanks.

    --
    Keith


      My System SpecsSystem Spec

  9. #9


    Sung M Kim Guest

    Re: XML with Item tags


    public news groups wrote:
    > A link to a bug report on this issue is at connect if anyone would like to
    > review and/or vote on it.
    >
    > https://connect.microsoft.com/feedba...6697&SiteID=99


    The case is already "closed" and "resolved"...
    I wonder if it's still worth voting for it and what the solution was
    for this case...


      My System SpecsSystem Spec

  10. #10


    public news groups Guest

    Re: XML with Item tags

    "Sung M Kim" <DontBotherMeWithSpam@gmail.com> wrote in message
    > The case is already "closed" and "resolved"...


    It is neither. When it is closed or resolved a date will appear next to
    those words.

    See
    https://connect.microsoft.com/feedba...1259&SiteID=99
    for an example. The resolution wouldn't please everyone since it is:
    Thank you for reporting this. This bug has been postponed to future release
    of PowerShell. Posted by Microsoft on 10/24/2006 at 3:56 PM



      My System SpecsSystem Spec

XML with Item tags

Similar Threads
Thread Thread Starter Forum Replies Last Post
tags KRK Vista General 1 11 Mar 2010
rename-item, move-item and special chars. sardinian_guy PowerShell 3 26 Jul 2009
Copy-Item : Container cannot be copied onto existing leaf item. Steve PowerShell 3 17 Mar 2009
I can't delete the item in the "delete item" folder in window mail Banana Vista mail 10 19 Jan 2008
MP3 Tags juanpablo Vista music pictures video 2 31 Jul 2007