Create empty XML as specced (create additional content)
Oxygen general issues.
-
- Posts: 81
- Joined: Sat Aug 05, 2006 10:43 pm
Create empty XML as specced (create additional content)
I want to create a template of an Atom feed, that contains all the elements, that are possible. I thought I could do this by selecting "create additional content" in the New-File wizard.
The Atom is specced via a RelanxNG/compact and this did not allow for creation of additional content. So I transformed that into an XML Schema, using oXygen. When I select "feed" as root element I get only author and feed elements, but not all the other possibilities.
Any ideas ? I thought it would be possible to create an empty template with all elements possible this way ?
Thanks.
The Atom is specced via a RelanxNG/compact and this did not allow for creation of additional content. So I transformed that into an XML Schema, using oXygen. When I select "feed" as root element I get only author and feed elements, but not all the other possibilities.
Any ideas ? I thought it would be possible to create an empty template with all elements possible this way ?
Thanks.
Andreas
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
The generated elements depend on your schema. As you can see in the Create an XML document dialog in the XML Schema tab only optional content and first choice particles can be generated in the new document with the File -> New action. Did you check the two checkboxes and there are first choice particles or optional content that are not generated in the new document?
If you want a complete XML document you can use the XML document instance generator available from menu Tools -> Generate Sample XML Files.
Regards,
Sorin
The generated elements depend on your schema. As you can see in the Create an XML document dialog in the XML Schema tab only optional content and first choice particles can be generated in the new document with the File -> New action. Did you check the two checkboxes and there are first choice particles or optional content that are not generated in the new document?
If you want a complete XML document you can use the XML document instance generator available from menu Tools -> Generate Sample XML Files.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
If you need to generate a document from the same schema many times you can generate the document only once and then add it to the list of document templates from menu File -> Add to Templates. When you need a new document just generate it from the template using File -> New from Templates.
Regards,
Sorin
If you need to generate a document from the same schema many times you can generate the document only once and then add it to the list of document templates from menu File -> Add to Templates. When you need a new document just generate it from the template using File -> New from Templates.
Regards,
Sorin
-
- Posts: 81
- Joined: Sat Aug 05, 2006 10:43 pm
Thanks.
Yes, I checked the two boxes for additional content. I was trying to draw a full Atom XML template from the Schema. I chose 'feed' as root element.
I still run into problems, using the "Create Sample XML Documents" but maybe there is no way around them.
If I create it with the "additional content" options on, I get a similarily short result (ie not all tags are available in the sample), though I have <ANY> - <ANY> set and both checkboxes (additional content, etc.) checked.
If I chose the "add additional tags in comments" option, I get a very verbose file, that seems to include all and everything. But this file requires too much editing to work with.
Also it seems to be impossible to leave the default-namespace empty, like in
should really become
Therefore I tried to leave the edit dialog for the renaming of the namespaces (I got ns1 and ns2) empty for ns1, but the dialog would not accept an empty string.
Yes, I checked the two boxes for additional content. I was trying to draw a full Atom XML template from the Schema. I chose 'feed' as root element.
I still run into problems, using the "Create Sample XML Documents" but maybe there is no way around them.
If I create it with the "additional content" options on, I get a similarily short result (ie not all tags are available in the sample), though I have <ANY> - <ANY> set and both checkboxes (additional content, etc.) checked.
If I chose the "add additional tags in comments" option, I get a very verbose file, that seems to include all and everything. But this file requires too much editing to work with.
Also it seems to be impossible to leave the default-namespace empty, like in
Code: Select all
<atom:link />
<html:br />
Code: Select all
<link />
<html:br />
Andreas
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
Regards,
Sorin
If I understand correctly with the options for optional elements the generated XML instance is too short and if you add also the option to generate the rest of the options as comments the instance is too long. In that case you can try with the other choice strategy for selecting an alternative inside an <xs:choice> and <xs:substitutionGroup>, that is Random instead of First. If this is also too short then I recommend generating one XML instance with the option to generate the rest of the options as comments, edit this instance and remove unnecessary options until you get an acceptable template and then add this template to the list of oXygen XML templates using the action File -> Add to Templates. After that use the template from File -> New from Templates for every new Atom feed document that you will create.amix wrote:If I create it with the "additional content" options on, I get a similarily short result (ie not all tags are available in the sample), though I have <ANY> - <ANY> set and both checkboxes (additional content, etc.) checked.
If I chose the "add additional tags in comments" option, I get a very verbose file, that seems to include all and everything. But this file requires too much editing to work with.
No, it is not impossible. Just select the namespace that you want to be used without prefix in the Default Namespace combo box of the dialog for generating XML instances.amix wrote:Also it seems to be impossible to leave the default-namespace empty, like inshould really becomeCode: Select all
<atom:link />
<html:br />Therefore I tried to leave the edit dialog for the renaming of the namespaces (I got ns1 and ns2) empty for ns1, but the dialog would not accept an empty string.Code: Select all
<link />
<html:br />
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
The options generated as comment are the ones defined in the same choice element or in the same substitution group as the option generated before the comment. They cannot be generated without the comments because if the XML instance contains more than one option of a choice element that instance is not valid against the XML Schema used to generate it.
Regards,
Sorin
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service