XPath is a language for addressing parts of an XML document. The following are XPaths to the XHTML Content in Business Wire's NewsML.
Release Body
/NewsML/NewsItem/NewsComponent/NewsComponent/NewsComponent[Role/@FormalName="Body"]/ContentItem[Format/@FormalName="XHTML"]/DataContent
Contact Information
/NewsML/NewsItem/NewsComponent/NewsComponent/NewsComponent[Role/@FormalName="Contact"]/ContentItem[Format/@FormalName="XHTML"]/DataContent
Headline
/NewsML/NewsItem/NewsComponent/NewsComponent/NewsComponent[Role/@FormalName="HeadLine"]/ContentItem[Format/@FormalName="XHTML"]/DataContent
Sub Headline
/NewsML/NewsItem/NewsComponent/NewsComponent/NewsComponent[Role/@FormalName="SubHeadLine"]/ContentItem[Format/@FormalName="XHTML"]/DataContent
BWTag XPath
//NewsML/NewsItem/NewsComponent/Metadata[MetadataType/@FormalName='BWTags']/Property[@FormalName='BWTag']/@Value
BWHashTag XPath
//NewsML/NewsItem/NewsComponent/Metadata[MetadataType/@FormalName='BWTags']/Property[@FormalName='BWHashTag']/@Value
BWCashTag XPath
//NewsML/NewsItem/NewsComponent/Metadata[MetadataType/@FormalName='BWTags']/Property[@FormalName='BWCashTag']/@Value
Social Media Profile XPath
//NewsML/NewsItem/NewsComponent/Metadata[MetadataType/@FormalName='BWSocialMediaProfile']/Property[@Scheme='BWSocialMediaProfile' and @FormalName='Profile']/@ValueRef
Social Media Profile XPath for a Specific Network
//NewsML/NewsItem/NewsComponent/Metadata[MetadataType/@FormalName='BWSocialMediaProfile']/Property[@Scheme='BWSocialMediaProfile' and @FormalName='Profile' and @Value='Twitter']/@ValueRef
Smart Multimedia XPath (Role: "Smart Multimedia")
/NewsML/NewsItem/NewsComponent/NewsComponent/NewsComponent[Role/@FormalName='Smart Multimedia']/ContentItem/DataContent/html/body/div
Smart Multimedia, with the Desired Role and Format Included
/NewsML/NewsItem/NewsComponent/NewsComponent/NewsComponent[Role/@FormalName='<ROLE>']/ContentItem[Format/@FormalName='XHTML']/DataContent/[namespace-uri()='http://www.w3.org/1999/xhtml' and local-name()='html']/[namespace-uri()='http://www.w3.org/1999/xhtml' and local-name()='body']/*[namespace-uri()='http://www.w3.org/1999/xhtml' and local-name()='div']
Cascading Style Sheet (CSS), Containing Recommended Styles for All XHTML Content Within the NewsML Document
/NewsML/NewsItem/NewsComponent/NewsComponent/NewsComponent[Role/@FormalName="StyleSheet"]/ContentItem[Format/@FormalName="CSS"]/DataContent
Note: Each piece of XHTML content in a Business Wire NewsML release is a complete XHTML document. Therefore, to assemble these into one HTML view of this release, only the first paragraph from each XHTML content item is needed. Add the following to any XPath listed above, except the XPath to the CSS content, to retrieve the HTML content starting with the first paragraph.
/*[namespace-uri()='http://www.w3.org/1999/xhtml' and local-name()='html']/*[namespace-uri()='http://www.w3.org/1999/xhtml' and local-name()='body']/*[namespace-uri()='http://www.w3.org/1999/xhtml' and local-name()='p'][1]
For more information please contact: info@businesswire.com