Code Monkey home page Code Monkey logo

Comments (5)

atschwarz avatar atschwarz commented on July 23, 2024

Hi again,

another issue on the same topic. After fixing the above error by correct the xml namespace, the XML Parser of cling again complains. The event xml looks like this:

<?xml version="1.0"?>
<Event xmlns="urn:schemas-upnp-org:metadata-1-0/RCS/">
    <InstanceID val="0">
        <GreenVideoGain val="0"/>
        <BlueVideoBlackLevel val="0"/>
        <VerticalKeystone val="0"/>
        <GreenVideoBlackLevel val="0"/>
        <Volume val="70"/>
        <Loudness val="0"/>
        <A_ARG_TYPE_InstanceID val="0"/>
        <RedVideoGain val="0"/>
        <ColorTemperature val="0"/>
        <Sharpness val="0"/>
        <A_ARG_TYPE_PresetName val=""/>
        <RedVideoBlackLevel val="0"/>
        <BlueVideoGain val="0"/>
        <Mute val="0"/>
        <A_ARG_TYPE_Channel val=""/>
        <HorizontalKeystone val="0"/>
        <VolumeDB val="-3072"/>
        <PresetNameList val=""/>
        <Contrast val="0"/>
        <Brightness val="0"/>
    </InstanceID>
</Event>

The error is the following:

Caused by: org.xml.sax.SAXException: cvc-complex-type.4: Attribute 'channel' must appear on element 'Volume'.
org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 18; cvc-complex-type.4: Attribute 'channel' must appear on element 'Volume'.

The underlying xml schema looks like this:

    <xsd:element name="Volume">
        <xsd:complexType>
            <xsd:attribute name="val" type="xsd:unsignedInt"
                           use="required"/>
            <xsd:attribute name="channel" type="xsd:string"
                           use="required"/>
        </xsd:complexType>
    </xsd:element>

You find the full schema at https://raw.github.com/4thline/cling/master/support/src/main/resources/org/fourthline/cling/support/renderingcontrol/metadata-1.0-rcs.xsd

The author also add a note at the beginning of the file, which explains the problem with the event namespaces:

<!--
TODO: UPNP VIOLATION: RenderingControl 1.0 specification schema says "/RCS/" but examples
in the spec say "/AVT_RCS". We had "/AVT_RCS", then "/RCS", now we have "/RCS/", let's
see who complains.
-->

Thanks and best regards,
Andreas

from gmrender-resurrect.

hzeller avatar hzeller commented on July 23, 2024

Thanks for the report. Good to have XML parsers that are a bit more strict to uncover these problems. I'll have a look.

from gmrender-resurrect.

hzeller avatar hzeller commented on July 23, 2024

Please check it out, this should fix both these issues.

from gmrender-resurrect.

atschwarz avatar atschwarz commented on July 23, 2024

Thanks for the quick fix. But a small change is necessary, because you forgot the Loudness-Attribute.

     Loudness

    ============================================================-->
    <xsd:element name="Loudness">
        <xsd:complexType>
            <xsd:attribute name="val" type="xsd:boolean"
                           use="required"/>
            <xsd:attribute name="channel" type="xsd:string"
                           use="required"/>
        </xsd:complexType>
    </xsd:element>

So you have to change the if-condition inside variable_container.c to

if (strcmp(name, "Volume") == 0
            || strcmp(name, "VolumeDB") == 0
            || strcmp(name, "Mute") == 0
            || strcmp(name, "Loudness") == 0) {
                xmlelement_set_attribute(builder->change_event_doc,
                                         xml_value, "channel", "Master");
        }

I've already tested this small change on my local version and now the XML-Parser parses the event xml complaint-free ;-)
Thanks again and best regards,
Andreas

from gmrender-resurrect.

hzeller avatar hzeller commented on July 23, 2024

Alright, should be working now. Thanks for the report!

from gmrender-resurrect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.