I am playing around with XSLT for a small task. I have the following XML:
<PFeed> <PID> MyProcess </PID> <Version>1</Version> <MetaData> <Id> MyMetadataId </Id> </MetaData> <AllFeeds> <FeedContent> <Id> FeedContentId </Id> </FeedContent> </AllFeeds> </PFeed> I want to extract FeedContentId as text from this XML.
This is the XSLT code I have:
<?xml version="1.0" encoding="utf-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" encoding="UTF-8" /> <xsl:template match="/PFeed/AllFeeds/FeedContent"> <xsl:value-of select="Id"/> </xsl:template> </xsl:stylesheet> But instead of outputting FeedContentId I get the following: MyProcess 1 MyMetadataId FeedContentId
Can you please point out what I am missing ?
No comments:
Post a Comment