나는 당신의 질문을 이해하지 못합니다.
나는 당신의 XSD는 다음과 같이 XML을 생성하는 당신에게 자바 클래스를 줄 것이라고 생각 :
<book author="Fred" title="The Lady and a Little Dog" />
당신이 당신과 같은 XML로 끝날 수 있도록, XML 요소 내에서 "내부"텍스트를 설정하려는 뜻 이?
Book book= books.addNewBook();
book.setAuthor("Fred");
book.setTitle("The Lady and a Little Dog");
: 그럼 당신은 간단하게 할 수 있습니다
<xs:sequence>
<xs:element name="Book">
<xs:complexType>
<xs:sequence>
<xs:element name="author" type="xs:string" />
<xs:element name="title" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
: 그렇다면
<book>
<author>Fred</author>
<title>The Lady and a Little Dog</title>
</book>
은이에 XSD를 변경 속성보다는 중첩 된 요소를 사용하는
업데이트
확인 - 이제는 이해합니다. 다음
<xs:element name="Book" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="author" type="xs:string" />
<xs:attribute name="title" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
을 그리고 :
이 시도
당신이 원하는 어느 제가 생각이 같은 XML을 제공해야
Book book1 = books.addNewBook();
book1.setAuthor("Fred");
book1.setTitle("The Lady and a Little Dog");
book1.setStringValue("This is some text");
Book book2 = books.addNewBook();
book2.setAuthor("Jack");
book2.setTitle("The Man and a Little Cat");
book2.setStringValue("This is some more text");
:
<Book author="Fred" title="The Lady and a Little Dog">This is some text</Book>
<Book author="Jack" title="The Man and a Little Cat">This is some more text</Book>
이것은 내가 무엇을 것입니다 내 xml처럼 보이게 : 이것은 일부 텍스트입니다 어떻게"This is some text "비트를 넣을 수 있습니까? 감사합니다. –
dogbane
답변을 업데이트했습니다. 더 도움이 되었기를 바랍니다. –