Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4583042
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:09:35+00:00 2026-05-21T21:09:35+00:00

* *Edit – in the end I removed the abstract extension to get this

  • 0

**Edit – in the end I removed the abstract extension to get this to function, the answer below from Blaise then works

Hello.
I have a complex type in my schema:

<xs:complexType name="AbstractWorkflow" abstract="true">
    <xs:attribute name="id" type="xs:ID" use="required"/>
</xs:complexType>
<xs:complexType name="ProcessWorkflow" mixed="true">
    <xs:complexContent>
        <xs:extension base="AbstractWorkflow"/>
    </xs:complexContent>
</xs:complexType>

The input to be unmarshalled is this

<ns1:Workflow stb:id="Workflow" xsi:type="ns1:ProcessWorkflow">workflowHTML.xml</ns1:Workflow>

But when I do this I get no option to access the value: workflowHTML.xml from the classes
that have been generated from xjc. This is the start of the generated AbstractWorkflow class is there an annotation that I can declare in this class, that extends an abstract class, to specify that it is an element that carries a value itself? Shoud it not be declared as a FIELD or?

Edit it is the extending class that I need to implement the reading of a value not the abstract class that I had here originally.

@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
@XmlType(name = "ProcessWorkflow")
public class ProcessWorkflow
    extends AbstractWorkflow
{



}

Thanks for reading.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T21:09:36+00:00Added an answer on May 21, 2026 at 9:09 pm

    I believe you are looking for the @XmlValue annotation.

    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlRootElement
    public class Foo {
    
        @XmlAttribute
        private int id;
    
        @XmlValue
        private String value;
    
    }
    

    The above corresponds to the following XML schema:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    
      <xs:element name="foo" type="foo"/>
    
      <xs:complexType name="foo">
        <xs:simpleContent>
          <xs:extension base="xs:string">
            <xs:attribute name="id" type="xs:int" use="required"/>
          </xs:extension>
        </xs:simpleContent>
      </xs:complexType>
    </xs:schema>
    

    And XML like this:

    <foo id="123">Some Value</foo>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: looking for this: http://diminishing.org/extending-formtastic-with-a-sprinkle-of-jquery (If this works I'll answer my own question) I've
Edit: I have solved this by myself. See my answer below I have set
EDIT 07/14 As Bill Burgess mentionned in a comment of his answer, this question
EDIT: See my answer below--> I am wanting to have a view that when
Edit: The below question was answered by this . I have a new updated
EDIT Leaving this for posterity, but nearly a year later, to get down voted,
EDIT: I'd like to get a definitive answer on whether or not it's possible
EDIT: Updated thanks to @daroczig's lovely answer below. However, test 2 still feels like
Edit: From another question I provided an answer that has links to a lot
EDIT - I was able to fix this problem using code from 'Farray' with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.