xslt - XSL: Converting External XML to readable XML -


a lot of question covered here, left few additional problems: apply xsl external xml

here xml , xsl using:

xml:

<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="http://image1.frequency.com/xslt/sample.xslt" ?> <wrapper source="http://image1.frequency.com/xml/externalxml.xml"/> 

external xml

 <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/atom" xmlns:a="http://www.w3.org/2005/atom" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gazeebo="http://www.vimond.com/vimondfeedextension/1.0" xmlns:machinima="http://xml.machinima.com/fields" xmlns:media="http://search.yahoo.com/mrss/" xmlns:plmedia="http://xml.theplatform.com/media/data/media">    <title>feed</title>    <updated>2016-05-25t00:53:54z</updated>    <entry>       <id>guid</id>       <title>video title</title>       <content type="text">description text</content>       <gazeebo:metadata name="description-short">description text</gazeebo:metadata>       <gazeebo:metadata name="description-long" />       <updated>2016-05-24t20:52:24z</updated>       <gazeebo:metadata name="episode">2153</gazeebo:metadata>       <gazeebo:metadata name="genre">news</gazeebo:metadata>       <gazeebo:metadata name="parental-guidance">tv-14</gazeebo:metadata>       <gazeebo:metadata name="season">2</gazeebo:metadata>       <gazeebo:metadata name="title" />       <gazeebo:metadata name="hd">hd</gazeebo:metadata>       <gazeebo:metadata name="actors">actors</gazeebo:metadata>       <gazeebo:metadata name="asset-length">192</gazeebo:metadata>       <gazeebo:metadata name="director">director</gazeebo:metadata>       <gazeebo:metadata name="tags">uncharted</gazeebo:metadata>       <gazeebo:metadata name="original-air-date">2016-05-23</gazeebo:metadata>       <media:group>          <media:thumbnail url="https://internal-dist.s3.amazonaws.com/s3.jpg" />          <media:content url="http://link.theplatform.com/media&amp;format=redirect" type="video/mpeg" />          <dcterms:valid>start=2016-05-27t07:00:00z;end=2016-12-12t07:00:00z;scheme=w3c-dtf</dcterms:valid>       </media:group>    </entry> </feed> 

xslt

    <xsl:stylesheet version="2.0" xmlns="http://www.w3.org/2005/atom" xmlns:a="http://www.w3.org/2005/atom" xmlns:xsl="http://www.w3.org/1999/xsl/transform" >  <xsl:template match="wrapper">   <xsl:apply-templates select="document(./@source)"/> </xsl:template>       <xsl:template match="entry/id">         <cd-name><xsl:apply-templates select="@*|node()" /></cd-name>     </xsl:template>     <xsl:template match="entry">         <catalog-name><xsl:apply-templates select="@*|node()" /></catalog-name>     </xsl:template>        <xsl:template match="@*|node()">         <xsl:copy copy-namespaces="no">             <xsl:apply-templates select="@*|node()" />         </xsl:copy>     </xsl:template>  </xsl:stylesheet> 

when run them through tool: xslttest.appspot.com , output want (changing on entry on item)

<?xml version="1.0" encoding="utf-8"?> <feed>    <title>feed</title>    <updated>2016-05-25t00:53:54z</updated>    <item>       <id>guid</id>       <title>test title</title>       <content type="text">description text</content>       <metadata name="description-short">description text</metadata>       <metadata name="description-long"/>       <updated>2016-05-24t20:52:24z</updated>       <metadata name="episode">2153</metadata>       <metadata name="genre">news</metadata>       <metadata name="parental-guidance">tv-14</metadata>       <metadata name="season">2</metadata>       <metadata name="title"/>       <metadata name="hd">hd</metadata>       <metadata name="actors">actor</metadata>       <metadata name="asset-length">192</metadata>       <metadata name="director">director</metadata>       <metadata name="tags">uncharted</metadata>       <metadata name="original-air-date">2016-05-23</metadata>       <group>          <thumbnail url="https://internal-dist.s3.amazonaws.com/s3.jpg"/>          <content url="http://link.theplatform.com/media&amp;format=redirect"                   type="video/mpeg"/>          <valid>start=2016-05-27t07:00:00z;end=2016-12-12t07:00:00z;scheme=w3c-dtf</valid>       </group>    </item> </feed> 

however, when @ page, doesn't appear readable. renders text, , skips out nodes, , if inspect source, shows wrapper, think i'm unable parse it?

when @ page appears (renders text): http://image1.frequency.com/wrapper-test3.xml

so, long , short of it, how can nodes show on page? it's weird shows on tool correctly, when try view page hosted, doesn't work right. there way i.e. exporting correct outcome doc has in view-source correctly? need parser @ tags on page, why i'm transforming xml xml in first place, can match specs.

any appreciated. willing use technology well, copying document js , putting page. need transform xml more usable form, seemingly simple.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -