-
1. Re: xsd:attribute ref unsupported in unmarshaller
aloubyansky Aug 8, 2007 2:19 AM (in response to anil.saldhana)addChild is not supposed to be called for an attribute. Attributes are passed as an argument to newChild.
-
2. Re: xsd:attribute ref unsupported in unmarshaller
aloubyansky Aug 8, 2007 2:21 AM (in response to anil.saldhana)Ah, you meant GenericValueContainer.addChild. That one should be called.
-
3. Re: xsd:attribute ref unsupported in unmarshaller
aloubyansky Aug 8, 2007 3:02 AM (in response to anil.saldhana)I haven't written a testcase but looking at the code, if it's not called it looks like the attribute is not added to Attributes passed to the startElement by the XML parser.
-
4. Re: xsd:attribute ref unsupported in unmarshaller
anil.saldhana Aug 8, 2007 8:28 AM (in response to anil.saldhana)I made the attribute ref change to my schema this week (and not checked in AS trunk yet). Yesterday while debugging something, saw this issue.
Do you want me to create some kind of a test case for this? It will take a day or two (I am travelling).
I am guessing that you should be able to pull out a quick test case yourself. :) -
5. Re: xsd:attribute ref unsupported in unmarshaller
aloubyansky Aug 9, 2007 7:05 AM (in response to anil.saldhana)I've added a testcase
package org.jboss.test.xml; public class AttributeRefUnitTestCase extends AbstractJBossXBTest
I guess... the problem is that the attribute is bound into the target namespace and should be used in the XML content with the corresponding namespace. Have a look at the testcase I added. -
6. Re: xsd:attribute ref unsupported in unmarshaller
anil.saldhana Aug 9, 2007 9:00 AM (in response to anil.saldhana)test checked in? Do not see it at:
http://anonsvn.jboss.org/repos/jbossas/trunk/testsuite/src/main/org/jboss/test/xml/ -
7. Re: xsd:attribute ref unsupported in unmarshaller
aloubyansky Aug 9, 2007 9:06 AM (in response to anil.saldhana)Author: alex.loubyansky@jboss.com Date: 2007-08-09 06:28:12 -0400 (Thu, 09 Aug 2007) New Revision: 2476 Added: jbossxb/trunk/src/test/java/org/jboss/test/xml/AttributeRefUnitTestCase.java Log: a testcase for <attribute ref='...'
anonsvn delay... -
8. Re: xsd:attribute ref unsupported in unmarshaller
aloubyansky Aug 9, 2007 9:08 AM (in response to anil.saldhana)Plus, it's in jbossxb, not as...
-
9. Re: xsd:attribute ref unsupported in unmarshaller
anil.saldhana Aug 13, 2007 12:02 PM (in response to anil.saldhana)Alex, did you fix any XB code to support this?
Because I have not got it to work yet. In a few days, I will create a test case for you to comment/guide me. For now, I am not using attribute ref temporarily until the test case is done. -
10. Re: xsd:attribute ref unsupported in unmarshaller
aloubyansky Aug 13, 2007 2:50 PM (in response to anil.saldhana)No, I haven't fixed anything. Can you modify the test I committed?
-
11. Re: xsd:attribute ref unsupported in unmarshaller
anil.saldhana Aug 14, 2007 11:48 AM (in response to anil.saldhana)Alex, I have a test case for this at :
https://svn.jboss.org/repos/jbossas/projects/security/security-jboss-sx/trunk/
The test is:
https://svn.jboss.org/repos/jbossas/projects/security/security-jboss-sx/trunk/src/tests/org/jboss/test/security/config/JBossXBSchemaBindingUnitTestCase.java
The schema file for the test is:
https://svn.jboss.org/repos/jbossas/projects/security/security-jboss-sx/trunk/src/resources/schema/security-config_5_0.xsd
The xml file for the test is:
https://svn.jboss.org/repos/jbossas/projects/security/security-jboss-sx/trunk/src/tests/resources/config/securityConfig5.xml
From the test, you can see that it is failing at JBossXBSchemaBindingUnitTestCase->testValidateJAASConfiguration()->assertEquals("Optional expected", AppConfigurationEntry.LoginModuleControlFlag.OPTIONAL, ace.getControlFlag());
Sorry, I took this route rather than modifying your XB test because I am unsure what issues my schema file has. :) Plus this is the schema that will drive the AS5 security configuration. -
12. Re: xsd:attribute ref unsupported in unmarshaller
aloubyansky Aug 15, 2007 2:30 AM (in response to anil.saldhana)Try defining a namespace prefix for "urn:jboss:security-config:5.0" and using the prefix with the flag attribute.
<policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:security-config:5.0" xmlns="urn:jboss:security-config:5.0" xmlns:ns="urn:jboss:security-config:5.0"> ... <login-module code = "org.jboss.test.TestLoginModule" ns:flag = "required">
-
13. Re: xsd:attribute ref unsupported in unmarshaller
anil.saldhana Aug 15, 2007 10:42 AM (in response to anil.saldhana)Alex, that is what I have currently:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jbsx="urn:jboss:security-config:5.0" xmlns="urn:jboss:security-config:5.0" .... <xsd:attribute name="flag"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value="required"/> <xsd:enumeration value="requisite"/> <xsd:enumeration value="sufficient"/> <xsd:enumeration value="optional"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:element name="login-module" type="jbsx:loginModuleInfo"/> <xsd:complexType name="loginModuleInfo"> <xsd:annotation> <xsd:appinfo> <jbxb:class impl="org.jboss.security.auth.login.AppConfigurationEntryHolder"/> </xsd:appinfo> </xsd:annotation> <xsd:sequence> <xsd:element ref="jbsx:module-option" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="code" type="xsd:string" use="required"/> <xsd:attribute ref="jbsx:flag" use="required"/> </xsd:complexType>
The xsd:element ref has been working for a long time now. I think it is the attribute ref that is not working. The attr ref is exactly like the element ref in terms of ns/prefix.
I created a JIRA issue for this for records.
http://jira.jboss.com/jira/browse/JBXB-106 -
14. Re: xsd:attribute ref unsupported in unmarshaller
aloubyansky Aug 15, 2007 12:35 PM (in response to anil.saldhana)Have you tried doing what I suggested?