Menu

Confused about Elements

Help
2009-12-24
2013-05-01
  • PixelPusher

    PixelPusher - 2009-12-24

    I'm just starting to work with Jaxe, so I apologize in advance if this question seems silly.
    I am unable to add a plain old xs:element (or Element) to a Group. Shouldn't I be able to add an element to just about anything?

    The same question applies to adding comments. I have not figured out how to add them, either.

    Thanks for an otherwise really nice editor!
    Thom

     
  • Damien Guillaume

    Are you trying to create a W3C schema ?
    You can add xs:element elements in many places, but sometimes you need intermediary structures such as xs:sequence or xs:choice. Which is actually the case for xs:group.

    To add a comment about something in your schema, you should add an xs:annotation at the beginning of it, and add an xs:documentation inside the xs:annotation.

    You should read the  for an introduction to this rather complex language.

      : http://www.w3.org/TR/xmlschema-0/

     
  • PixelPusher

    PixelPusher - 2009-12-30

    Thanks for your quick reply! I guess I wasn't clear about what I was trying to do. You were correct that I am building a W3C schema. I've mostly been using the XML schema tutorial on .

    I actually have a schema that I created by hand and I'm trying to make it usable in Jaxe, with the appropriate _config.xml file. I have the basic configuration working, but I'm trying to extend it to allow the end user to do things like add comments (with comment tags "<!- ->") to their XML file and also restrict the elements that are allowed in certain situations.

    I found that I can add an Insertion Menu element for comments to the menus, but that does not make the comment option appear in the Insert panel. Is there a way to add the Comment item to the Insert panel?

    I also found that the <xs:all> order indicator is not supported by Jaxe though you do support <xs:choice> and <xs:sequence>. Is this intentional, or an area for future development? I am trying to create a Complex type element that contains several elements, one of which is required while the rest are optional. I thought the code should look like this, but Jaxe complains about invalid syntax with an "X" on both the Complex type and xs:all tags…

        <xs:element name="myOptions">
        <xs:complexType>
            <xs:all>
                <xs:element maxOccurs="1" minOccurs="1" ref="requiredOption"></xs:element>
                <xs:element maxOccurs="1" minOccurs="0" ref="option1"></xs:element>
                <xs:element maxOccurs="1" minOccurs="0" ref="option2"></xs:element>
            </xs:all>
        </xs:complexType>
        </xs:element>

      : http://www.w3schools.com

     
  • Damien Guillaume

    > I found that I can add an Insertion Menu element for comments to the menus, but that does not make the comment option appear in the Insert panel. Is there a way to add the Comment item to the Insert panel?

    Sorry, there is currently no way to do that. I don't think it would be a good idea to always add a "XML comment" button in the insert panel (since it is allowed anywhere, and it might be confusing for XML languages using special elements for comments).

    > I also found that the &lt;xs:all&gt; order indicator is not supported by Jaxe though you do support &lt;xs:choice&gt; and &lt;xs:sequence&gt;. Is this intentional, or an area for future development?

    You should check this thread :

    Basically, you can use xs:all, but the real-time validation will not be complete : an element with more than one instance of a sub-element will be displayed as valid even though it is not. But the validation window with show the error.

    >  I am trying to create a Complex type element that contains several elements, one of which is required while the rest are optional. I thought the code should look like this, but Jaxe complains about invalid syntax with an "X" on both the Complex type and xs:all tags…

    Since xs:all is not fully supported in Jaxe, it is not included in the simplified superschema. So, your schema looks invalid although it is valid. You could use the real superschema instead if you wanted to avoid this problem.

      : http://sourceforge.net/tracker/?func=detail&aid=1947608&group_id=55234&atid=476297

     
  • PixelPusher

    PixelPusher - 2010-01-05

    Ah, that thread didn't come up when I searched the forums. Although it is unlikely that I will use it, how do I reference the "real" superschema?

     

Log in to post a comment.