Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tool for generating sample data file

Status
Not open for further replies.

MaineRunner

Programmer
Aug 28, 2007
5
US
Hello,

I am currently using XMLSpy, and have generated a sample xml file from the schema using XMLSpy. This function does not give me the ability to fill in fields to their max length, if they have a max length restriction.

My goal is to test the boundry condition of exceeding the max length. It would be nice to have a tool that can take a schema, generate a sample, and when the tool sees there is a max length restriction on the field, fill the field up to its max length. then it is a matter of simply adding one character (or maybe the tool could do it?)

Has anyone seen such a tool to generate a sample data file?

Thank you
 
Stylus Studio contains an 'XML Schema to XML' tool, but it does not seem to concern itself with restrictions.
Code:
<xs:schema xmlns:xs="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] targetNamespace="[URL unfurl="true"]http://www.w3schools.com"[/URL] xmlns="[URL unfurl="true"]http://www.w3schools.com"[/URL] elementFormDefault="qualified">
	<xs:element name="note">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="to" type="xs:string"/>
				<xs:element name="from" type="xs:string"/>
				<xs:element name="heading" type="xs:string">
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:length value="12"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:element>
				<xs:element name="body" type="xs:string"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
Code:
<?xml version="1.0"?>
<p1:note xmlns:p1="[URL unfurl="true"]http://www.w3schools.com"[/URL] xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xsi:schemaLocation="[URL unfurl="true"]http://www.w3schools.com[/URL] file:///c:/Documents%20and%20Settings/Tom%20M.WESTECH/Desktop/sample.xsd">
    <p1:to>string</p1:to>
    <p1:from>string</p1:from>
    <p1:heading>string</p1:heading>
    <p1:body>string</p1:body>
</p1:note>

Tom Morrison
 
That looks similar to what XMLSpy does. If you cut the length down to three does it truncate the text to 'str'? That would be the same functionality as XMLSpy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top