Generating sample xml from xsd
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 1
- Joined: Mon Dec 19, 2016 1:38 pm
Generating sample xml from xsd
-1
down vote
favorite
I've generated a sample XML from an XSD schema file here is a snippet of the output:
But ideally I need the sample file to contain attributes and data from the original XML file. So the output should be:
The attribute1,2,3 etc are actuall attribute names for the data element from the original XML.
Is this possible?
down vote
favorite
I've generated a sample XML from an XSD schema file here is a snippet of the output:
Code: Select all
<data name="name1">
<data name="name1">0</data>
<data name="name2">65535</data>
<data name="name3">1</data>
</data>
Code: Select all
<data name="attribute1" type="primary">
<data name="attribute2">
<data name="attribute3">_366170470</data>
<data name="attribute2">
<data name="attribute4">_120494376</data>
</data>
</data>
</data>
Is this possible?
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Generating sample xml from xsd
Hi,
The "Generate Sample XML Files" tool is designed to generate XML starting from an XML schema (XSD). There is no way to feed it content from an XML file. What you can do is configure some predefined values for some elements and attributes (the elements need to be declared globally in the schema).
Go to the Options tab, in the upper section press New and pick the Namespace and element name. Select the new element item from the upper list and switch to the "Attribute values" tab. Press New in that section and pick the namespace and name of the attribute. Select the new attribute item from the middle list and add the desired values in the bottom, "Values" section.
Regards,
Adrian
The "Generate Sample XML Files" tool is designed to generate XML starting from an XML schema (XSD). There is no way to feed it content from an XML file. What you can do is configure some predefined values for some elements and attributes (the elements need to be declared globally in the schema).
Go to the Options tab, in the upper section press New and pick the Namespace and element name. Select the new element item from the upper list and switch to the "Attribute values" tab. Press New in that section and pick the namespace and name of the attribute. Select the new attribute item from the middle list and add the desired values in the bottom, "Values" section.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 1
- Joined: Fri May 15, 2020 7:28 pm
Re: Generating sample xml from xsd
Hi Adrian,
I've read your advice with interest.
But please how could I add the curent date to the value for the date time element instead of the default generated date (2006-05-04).
Regards
Tai
I've read your advice with interest.
But please how could I add the curent date to the value for the date time element instead of the default generated date (2006-05-04).
Regards
Tai
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Generating sample xml from xsd
Hi,
You can't configure it to provide the current date, but you can manually enter a predefined specific date (which can be the current date).
Regards,
Adrian
You can't configure it to provide the current date, but you can manually enter a predefined specific date (which can be the current date).
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
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