Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

XSL and XML. I do not understand the error parsing?

Not actually! Fixed!

Trying to write a plugin for one good player. It uses XLST to parse results from an XML source file. Several hours were spent to catch the bug, but the attempts were unsuccessful.

Here is the XSL template:

<xsl:stylesheet version = '1.0' 
    xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method="xml"/> 
<xsl:template match="/">
    <xsl:element name="result">
        <xsl:element name="pagination">
            <xsl:element name="total"><xsl:for-each select="//pagination"><xsl:value-of select="pages"/></xsl:for-each></xsl:element>
        </xsl:element>
        <xsl:element name="items">
        <xsl:for-each select="//item">
            <xsl:element name="item">
                <xsl:attribute name="id"><xsl:value-of select="id"/></xsl:attribute>
                <xsl:element name="title"><xsl:value-of select="name"/></xsl:element>
                <xsl:element name="category"><xsl:value-of select="category"/></xsl:element>
                <xsl:element name="year"><xsl:value-of select="year"/></xsl:element>
                <xsl:element name="url"><xsl:value-of select="playerlink"/></xsl:element>
                <xsl:element name="image"><xsl:text></xsl:text></xsl:element>
                <xsl:element name="ipWebCamUrl"><xsl:text>0</xsl:text></xsl:element>
                <xsl:element name="files">
                        <xsl:element name="title"><xsl:value-of select="name"/></xsl:element>
                        <xsl:element name="url"><xsl:value-of select="playerlink"/></xsl:element>
                        <xsl:element name="verified"><xsl:text>1</xsl:text></xsl:element>
                </xsl:element>
            </xsl:element>
        </xsl:for-each>
        </xsl:element>
    </xsl:element>
</xsl:template>
</xsl:stylesheet>

Here is the XML file of the source that I send to the plugin:

<?xml version="1.0"?>
<root>
 <status>ok</status>
 <item>
  <id>1</id>
  <category>PUBLIC_FOLDER</category>
  <year>2018</year>
  <url>https://videomycdn.s3.amazonaws.com/video_92ff5k5sah.mp4</url>
  <image></image>
  <name>How to create web-site in 5 minutes.mp4</name>
  <link>12345</link>
  <seolink>https://videomycdn.s3.amazonaws.com/video_92ff5k5sah.mp4</seolink>
  <playerlink>https://videomycdn.s3.amazonaws.com/video_92ff5k5sah.mp4</playerlink>
  <size>200 MB</size>
  <files>1</files>
  <date>2018-10-02</date>
 </item>
 <item>
  <id>2</id>
  <category>PUBLIC_FOLDER</category>
  <year>2018</year>
  <url>video_12ff55fh.mp4</url>
  <image></image>
  <name>How to easy draw manga.mp4</name>
  <link>video_12ff55fh.mp4</link>
  <seolink>https://videomycdn.s3.amazonaws.com/video_12ff55fh.mp4</seolink>
  <playerlink>https://videomycdn.s3.amazonaws.com/video_12ff55fh.mp4</playerlink>
  <size>200 MB</size>
  <files>1</files>
  <date>2018-10-02</date>
 </item>
 <pagination>
  <pages>20</pages>
  <page>1</page>
 </pagination>
</root>

I conducted testing using https://www.online-toolz.com/tools/xslt-transformation.php where everything works as it should. But in the player itself, I encounter a data output error. I don’t have the source code for the program, there were only examples of the plug-in, since the project is frozen indefinitely, the developer is unlikely to be able to help. What can be wrong?

Not actually! Fixed!

Comments