Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michael Jensen 35 posts 85 karma points
    Jul 08, 2013 @ 14:20
    Michael Jensen
    0

    Trubbel getting my teamspeak webpost script to run in macro

    Hey,

    iam truning til get a blon on my guild website to show who is online on the teamspeak server.

    i ned this to be loadet ind the macro.

    <div id="ts3viewer_1022220" style="width: ; background-color: ;"></div>
    
                    <script type="text/javascript" src="http://static.tsviewer.com/short_expire/js/ts3viewer_loader.js"></script>
    
                    <script type="text/javascript">
                        var ts3v_url_1 = "http://www.tsviewer.com/ts3viewer.php?ID=1022220&text=000000&text_size=12&text_family=1&js=1&text_s_weight=bold&text_s_style=normal&text_s_variant=normal&text_s_decoration=none&text_s_color_h=525284&text_s_weight_h=bold&text_s_style_h=normal&text_s_variant_h=normal&text_s_decoration_h=underline&text_i_weight=normal&text_i_style=normal&text_i_variant=normal&text_i_decoration=none&text_i_color_h=525284&text_i_weight_h=normal&text_i_style_h=normal&text_i_variant_h=normal&text_i_decoration_h=underline&text_c_weight=normal&text_c_style=normal&text_c_variant=normal&text_c_decoration=none&text_c_color_h=525284&text_c_weight_h=normal&text_c_style_h=normal&text_c_variant_h=normal&text_c_decoration_h=underline&text_u_weight=bold&text_u_style=normal&text_u_variant=normal&text_u_decoration=none&text_u_color_h=525284&text_u_weight_h=bold&text_u_style_h=normal&text_u_variant_h=normal&text_u_decoration_h=none";
                        ts3v_display.init(ts3v_url_1, 1022220, 100);
                    </script>

    That is the code i godt from the webpost provider.

    i have tryed this

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
        version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:Examine="urn:Examine" 
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets Examine ">
    
    
    <xsl:output method="html" />
    
    <xsl:param name="currentPage"/>
    
    <xsl:template match="/">
    
    <div class="SideBlok">
            <div class="SideTop">
                <div class="SideBlokHeadline">
                    Teamspeak Webpost
                </div>
            </div>
            <div>
                <div class="SideMiddle">
                    <div id="ts3viewer_1022220" style="width: ; background-color: ;"></div>
    
                    <script type="text/javascript" src="http://static.tsviewer.com/short_expire/js/ts3viewer_loader.js"></script>
    
                    <script type="text/javascript">
                        var ts3v_url_1 = "http://www.tsviewer.com/ts3viewer.php?ID=1022220&text=000000&text_size=12&text_family=1&js=1&text_s_weight=bold&text_s_style=normal&text_s_variant=normal&text_s_decoration=none&text_s_color_h=525284&text_s_weight_h=bold&text_s_style_h=normal&text_s_variant_h=normal&text_s_decoration_h=underline&text_i_weight=normal&text_i_style=normal&text_i_variant=normal&text_i_decoration=none&text_i_color_h=525284&text_i_weight_h=normal&text_i_style_h=normal&text_i_variant_h=normal&text_i_decoration_h=underline&text_c_weight=normal&text_c_style=normal&text_c_variant=normal&text_c_decoration=none&text_c_color_h=525284&text_c_weight_h=normal&text_c_style_h=normal&text_c_variant_h=normal&text_c_decoration_h=underline&text_u_weight=bold&text_u_style=normal&text_u_variant=normal&text_u_decoration=none&text_u_color_h=525284&text_u_weight_h=bold&text_u_style_h=normal&text_u_variant_h=normal&text_u_decoration_h=none";
                        ts3v_display.init(ts3v_url_1, 1022220, 100);
                    </script>
                </div>
            </div>
            <div class="SideBottom">
            </div>
        </div>
    
    </xsl:template>
    
    </xsl:stylesheet>

    but i get this error.

    rror occured

    System.Xml.XmlException: '=' is an unexpected token. The expected token is ';'. Line 30, position 92. 
    at System.Xml.XmlTextReaderImpl.Throw(Exception e) 
    at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) 
    at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2) 
    at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(Int32 pos, String expectedToken1, String expectedToken2) 
    at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos) 
    at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars) 
    at System.Xml.XmlTextReaderImpl.FinishPartialValue() 
    at System.Xml.XmlTextReaderImpl.get_Value() 
    at System.Xml.Xsl.Xslt.XsltInput.ReadTextNodes() 
    at System.Xml.Xsl.Xslt.XsltInput.ReadNextSibling() 
    at System.Xml.Xsl.Xslt.XsltInput.MoveToFirstChild() 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadLiteralResultElement(Boolean asStylesheet) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadTemplate(NsDecl stylesheetNsList) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet() 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument() 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)

    Iam not the bigest shark to Xslt yet

    Best regards

    Michael

    Ps sorry for my bad english writning

    iam running version Umbraco v6.1.2 (Assembly version: 1.0.4927.23554) Hostede on a Surftown server IIS 7.0 whit fullthrust .Net 4.0 on a CE database.

    the site is @ this local http://wiyd.mj-solutions.dk

  • Mads Jørgensen 74 posts 226 karma points
    Jul 08, 2013 @ 14:30
    Mads Jørgensen
    0

    Hey,

    Whenever using <script></script> you need to put content of the script tags into <![CDATA[ script content ]]>.

    <script>
    <![CDATA[
    alert('john');
    ]]>
    </script> 
  • Michael Jensen 35 posts 85 karma points
    Jul 08, 2013 @ 15:01
    Michael Jensen
    0

    Hey Mads,

    i cant se to get it to work. i made a statik version of wath i has to be like and a macro like the one poste on the right side by i dos not work

    this is the macro as it is nowe

     <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
      <!ENTITY nbsp "&#x00A0;">
    ]>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:Examine="urn:Examine"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets Examine ">
    
    
      <xsl:output method="html" />
    
      <xsl:param name="currentPage"/>
    
      <xsl:template match="/">
    
        <div class="SideBlok">
          <div class="SideTop">
            <div class="SideBlokHeadline">
              Teamspeak Webpost
            </div>
          </div>
          <div>
            <div class="SideMiddle">
              <div id="ts3viewer_1022220" style="width: ; background-color: ;"></div>
    
              <script>
                <![CDATA[ src="http://static.tsviewer.com/short_expire/js/ts3viewer_loader.js"]]>
            </script>
    
              <script>
                <![CDATA[
                        <!--
    var ts3v_url_1 = "http://www.tsviewer.com/ts3viewer.php?ID=1022220&text=000000&text_size=12&text_family=1&js=1&text_s_weight=bold&text_s_style=normal&text_s_variant=normal&text_s_decoration=none&text_s_color_h=525284&text_s_weight_h=bold&text_s_style_h=normal&text_s_variant_h=normal&text_s_decoration_h=underline&text_i_weight=normal&text_i_style=normal&text_i_variant=normal&text_i_decoration=none&text_i_color_h=525284&text_i_weight_h=normal&text_i_style_h=normal&text_i_variant_h=normal&text_i_decoration_h=underline&text_c_weight=normal&text_c_style=normal&text_c_variant=normal&text_c_decoration=none&text_c_color_h=525284&text_c_weight_h=normal&text_c_style_h=normal&text_c_variant_h=normal&text_c_decoration_h=underline&text_u_weight=bold&text_u_style=normal&text_u_variant=normal&text_u_decoration=none&text_u_color_h=525284&text_u_weight_h=bold&text_u_style_h=normal&text_u_variant_h=normal&text_u_decoration_h=none";
    ts3v_display.init(ts3v_url_1, 1022220, 100);
    -->
                    ]]>
              </script>
    
            </div>
          </div>
          <div class="SideBottom">
          </div>
        </div>
    
      </xsl:template>
    
    </xsl:stylesheet>
  • Mads Jørgensen 74 posts 226 karma points
    Jul 08, 2013 @ 21:18
    Mads Jørgensen
    0

    Hi there Michael,

    Your issue now is right here:

    <script>
    <![CDATA[ src="http://static.tsviewer.com/short_expire/js/ts3viewer_loader.js"]]>
    </script>

    Should be:

    <script src="http://static.tsviewer.comYshort_expire/js/ts3viewer_loader.js">//tsviewer</script>

    Two rules applies to scripts i XSLT:

    1. Content between the script tags (when applying in-file JS) has to be within <![CDATA[]]>. This doesn't apply to attributes as src="" etc.

    2. avoid script tags selfclosing <script />, witch is the native thing for XSLT to do, the "descriptive comment" (//tsviewer) could be applied, another solution could very well be to throw an <xsl:comment></xsl:comment> tag in between the empty scirpt tags.

    Really hope this clarifies things a bit :-)

  • Michael Jensen 35 posts 85 karma points
    Jul 08, 2013 @ 21:30
    Michael Jensen
    0

    Hey Mads,

    sorry to say but this whit XSLT trowes me warry off and i belive it will take me a warry long time to get it in..

    I cant se to get the grasp op it and getting this macro to word i think i just have to make this one work as a stastic one on til i have better time.
    tryed to make the last chance you wrot but still no webpost

    I thanks you a lot to tryning to get me to get it right.

    Michael

Please Sign in or register to post replies

Write your reply to:

Draft