Melanie,
if you manually defined it as <xs:any> by modifying a generated class
(which Is what I assume you did), this means that you would not change
the acceptable multiplicity on that member (as expressed in the
XMLFieldDescriptor for that member).
Having said that, I'd be eager to learn as to why you are shying away
from re-generating Java sources from that schema.
Werner
Melanie Courtot wrote:
> Hi,
>
> I'm trying to unmarshall an XML that I'm getting back from mysql as a
> string.It's an svg file, I don't need to validate it or anything if t
> makes a difference.
>
> When I try to unmarshall it:
> SVGGlyph.unmarshal(new StringReader("" +
> "<?xml version=\"1.0\" encoding=\"UTF-8\"
> standalone=\"no\"?>\n" +
> "<svg>\n" +
> " <defs\n" +
> " id=\"defs4\">\n" +
> " </defs>\n" +
> " <g\n" +
> " style=\"opacity:1\"\n" +
> " id=\"layer2\">\n" +
> " </g>\n" +
> "</svg>")));
>
> I get the error:
> Exception in thread "main" java.lang.RuntimeException: element "g" occurs
> more than once.
> location: /svg/g{file: [not available]; line: 9; column: 7}
> ...
> Caused by: element "g" occurs more than once.
> location: /svg/g{file: [not available]; line: 9; column: 7}
> ...
> Caused by: ValidationException: element "g" occurs more than once.
> location: /svg/g
>
>
> I reduced the file to the minimum version throwing me that error.
> If I remove <defs...../defs> or <g..../g> no problem, but both together
> doesn't work.
>
> I think it may be related to the fact that as I didn't manage to (and I
> don't really want to!) generate the SVG classes from the schema
> http://www.w3.org/TR/2002/WD-SVG11-20020108/SVG.xsd, so I just defined it
> as anyObject. (which worked fine with a mathml fragment for example)
>
> class SVGGlyph:
>
> /**
> * Field _anyObject
> */
> private java.lang.Object _anyObject;
>
> and "traditionnal" methods marshal, unmarshal, set, get....
>
> so I actually get the XML string from the database, try to unmarshall it
> (then I get the validation exception) into an SVGGlyph object and then
> remarshall it with my other fields.
>
> Does anybody know how I could manage to export that XML embedded into my
> structure?
>
> Thanks,
> Melanie
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
>
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email