Creating Full Test XML Data Possibilities with Deeply Nested 'Choice' from XSD
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 2
- Joined: Fri May 03, 2019 5:18 pm
Creating Full Test XML Data Possibilities with Deeply Nested 'Choice' from XSD
Post by oxygenuser1 »
Hello! I am trying to generate an all-encompassing test XML that has every possible field from the XSD. There are many instances where I have 'Choice' elements that have grandchildren/great-grandchildren that contain additional 'Choice' elements. XSD file size is roughly 15,000 lines, and when we run through the "Generate Sample XML" function from the XML Editor, it will comment out 'Choice' Elements, but won't build out the commented branch. Any advice would be greatly appreciated!
Jeff
Jeff
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Creating Full Test XML Data Possibilities with Deeply Nested 'Choice' from XSD
Hello,
Unfortunately when there are grandchildren/great-grandchildren choices only one is selected to be generated and the others aren't generated at all.
We have an improvement request for this on our issue tracking tool. I've added another vote and mentioned your comment.
Regards,
Adrian
Unfortunately when there are grandchildren/great-grandchildren choices only one is selected to be generated and the others aren't generated at all.
We have an improvement request for this on our issue tracking tool. I've added another vote and mentioned your comment.
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: 2
- Joined: Fri May 03, 2019 5:18 pm
Re: Creating Full Test XML Data Possibilities with Deeply Nested 'Choice' from XSD
Post by oxygenuser1 »
Thanks so much! I was actually able to circumvent the issue by adjusting the XSD slightly from 'choice' to 'sequence' and updating some of the formatting accordingly! Was wondering if there was functionality to get a list of all possible XPaths from an XSD/XML. Any insight into that would be greatly appreciated!
Thanks,
Jeff
Thanks,
Jeff
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Creating Full Test XML Data Possibilities with Deeply Nested 'Choice' from XSD
Hi,
Here's a quick XQuery that does what you want on an XML instance. Can be run in the XPath/XQuery Builder with Saxon-PE XQuery:
This also covers XPaths to attributes. If you want only element XPaths, replace "//(*|@*)" with "//*"
Note that this strips down namespaces.
If you want absolutely every XPath of all XML nodes including comments, PIs and text, use "//node()".
Regards,
Adrian
Here's a quick XQuery that does what you want on an XML instance. Can be run in the XPath/XQuery Builder with Saxon-PE XQuery:
Code: Select all
distinct-values(
for $path in //(*|@*)
return replace(replace(path($path), "Q\{.*?\}",""), "\[\d+\]", "")
)
Note that this strips down namespaces.
If you want absolutely every XPath of all XML nodes including comments, PIs and text, use "//node()".
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