You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by ra...@scandent.com on 2005/05/22 09:42:50 UTC
All elements not appearing in the generated XML
Hi
We need all the elements that are defined in the XSD to appear in the XML.
Using xmlBeans we specifically set certain elements & hence those elements
appear in the XML. The elements which are not explicitly set using xmlBeans
does not appear in the XML. Is there a way (xsd indicator) in the XSD to
enforce a particular element to appear in the XML even if it does not hold
any value?
Could you pls help me on this?
Regards,
-----------------------------------------------------------------
Rajshree Lenin
Extension : 706.
------------------------------------------------------------------
Important Email Information :- The information in this email is
confidential and may be legally privileged. It is intended solely for
the addressee. Access to this email by anyone else is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is prohibited
and may be unlawful. If you are not the intended addressee please contact
the sender and dispose of this e-mail immediately.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
incorrect namespace when using changeType
Posted by Marius Gleeson <mg...@subscribe.audumla.net>.
I have found that I am getting an incorrect namespace being output when
I have used the changeType method.
My code does the following
Field field = fl.addNewField();
XTabField xtab = (XTabField) field.changeType(XTabField.type);
.
.
when I output this it creates the following
<db:field id="SXV4_FLD" xsi:type="sch:XTabField">
<db:displayName>Cust Last maintenance (mth)</db:displayName>
</db:field>
note the namespace on xsi:type.
what I want is
<db:field id="SXV4_FLD" xsi:type="db:XTabField">
<db:displayName>Cust Last maintenance (mth)</db:displayName>
</db:field>
The problem i get because of this is the next time i load the document,
a Field class is returned instead of an XTabField
class
any ideas
Thanks
Marius Gleeson.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
namespaces with xpath evaluation
Posted by Marius Gleeson <xm...@subscribe.audumla.net>.
I am trying to use the selectNodes functionality and have found that
namespaces are not being passed through to the saxon xpath evaluator.
Basically the code when creating the saxon evaluator does not pass any
supplied namespaces from the options into the evaluator.
This can be seen in src/store/org/apache/xmlbeans/impl/store/Path.java :
around line 92
static synchronized Path getCompiledPath(String pathExpr, int force,
String currentVar)
{
Path path = null;
Map namespaces = (force & USE_SAXON) != 0 ? new HashMap() :
null; <--- just an empty hashmap
if ((force & USE_XBEAN) != 0)
As i need this functionality I have editied my local copy so that it
looks like
static synchronized Path getCompiledPath(String pathExpr, int force,
String currentVar,XmlOptions options)
{
Path path = null;
Map namespaces = null;
if ((options != null) &&
(options.hasOption(XmlOptions.SAVE_SUGGESTED_PREFIXES)) ) {
namespaces = (Map)
options.get(XmlOptions.SAVE_SUGGESTED_PREFIXES);
}
else {
namespaces = (force & USE_SAXON) != 0 ? new HashMap() :
null;
}
Is there any other way I should be doing this, if not will this ability
be in the main branch soon, and does anyone know why the jaxen
functionality was dropped, but still works it you instantiate the
classes externally?
Cheers,
Marius Gleeson
--
Marius Gleeson
audumla@fastmail.fm
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org