Menu

Associating an XML Schema

Help
2008-08-05
2012-12-07
  • Richard Mott

    Richard Mott - 2008-08-05

    I love XML Copy Editor, and use it successfully with DTD validation. Now I want to write FLEX mxml scripts, and cannot get a schema associated successfully. When I select XML/Associate/XML Schema, the application is updated, apparently normally. But then when I click on Validate, I get this very obscure error message:

    Validation stopped at line 2, column 217: Complex type 'ct_ArrayCollection' violates the Unique Particle Attribution rule in its components '##any' and 'id'

    My script before association is
    <?xml version="1.0" encoding="UTF-8"?>
    <mx:Application>
    </mx:Application>

    and after schema association,
    <?xml version="1.0" encoding="UTF-8"?>
    <mx:Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.adobe.com/2006/mxml" xmlns:mx="http://www.adobe.com/2006/mxml" xsi:schemaLocation="http://www.adobe.com/2006/mxml D:/flex3.xsd">
    </mx:Application>

    I'm not excperienced with schema, and can't work it out. Presumably all of the namespace information is taken from the provided schema. But, is this a problem with the schema or with the editor?
    The provided schema starts with:
    <schema targetNamespace="http://www.adobe.com/2006/mxml" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:mx="http://www.adobe.com/2006/mxml">

    BTW, the entire schema (flex3.xsd, very big, 27,867 lines) can be downloaded from
        http://code.google.com/p/xsd4mxml/downloads/list

    Can anybody help? What, do I change to make the association work?
    THank you.

     
    • gnschmidt

      gnschmidt - 2008-08-07

      hi richard, sorry about the delay! will try to reproduce the error and get back to you.

      i'm sure we can get this to work.

      best,
      gerald

       
    • gnschmidt

      gnschmidt - 2008-08-07

      hi richard, my initial investigation suggests that flex3, out of the box, permits ambiguous content models.

      i think we may be able to get around this by making the validator's 'full schema constraint checking' feature optional, but i'd need to test this. if i comment out the two offending lines - the any and id entries of the complex type definition identified in the error message, the validation proceeds a little further and trips up over the next equivalent problem. do you know if anyone else has been able to validate these files? adobe's pages don't seem to offer a file with an explicit schema association at the top.

      presumably other parsers aren't as strict as Apache Xerces (which is used in xmlcopyeditor) in this regard...

      if i come up with a solution i'll be in touch!

      best,
      gerald

       
    • gnschmidt

      gnschmidt - 2008-08-07
       
    • Richard Mott

      Richard Mott - 2008-08-07

      Thanks for your investigation so far. I am beginning to understand the problem in the schema.

      Adobe releases the FLEX SDK as open-source code, but strangely has stopped including a schema for their mxml language. Hence the "xsd4mxml" project under google code. I will post an "issue" on their forum. I think Adobe does include their own schema under licence with their related (expensive) IDE -- which is itself available in the form of a plug-in for Eclipse. I will also complain to the Adobe FLEX site about withdrawing their own schema from the SDK for their own language!

      Anyway, I welcome any way forward if you can think of one. The idea of an option to turn off full checking sounds worth a try. Thank you very much for your time. Since the problem starts with an Adobe SDK, I expect other people will soon be running into the same difficulties.

       
    • Richard Mott

      Richard Mott - 2008-09-07

      Thank you for the help you provided for this problem. As promised I did file an issue on the xsd4mxml forum. I just received a response. They agree that their schema is ambiguous, suggested a solution, and offered an updated version to try. Their new version is working OK to validate my simple mxml. That's great. Of course it was your information that made the problem clear, and suggested what needed to be done. Again, thank you.

       
    • gnschmidt

      gnschmidt - 2008-09-08

      Thanks for letting me know!
      Gerald

       

Log in to post a comment.