xsd2html2xml icon indicating copy to clipboard operation
xsd2html2xml copied to clipboard

value of top level element not displayed in generated form

Open kgi-github opened this issue 6 years ago • 3 comments

I have noticed that when creating a filled form from an xml document the value of a top level element (if it's a type such as xs:integer or a simpleType) is not displayed.

I have two files. The first is test.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="qualified">

	<xs:element name="myThing" type="xs:integer"/>

</xs:schema>

The second file is myTest.xml:

<myThing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="test.xsd">
	1974
</myThing>

The value 1974 is not shown on the generated form after processing with xsd2html2xml. I am using version 3.3. Have I made a mistake somewhere?

kgi-github avatar Apr 05 '19 05:04 kgi-github

That doesn't have to do with it being the top-level element. It's because of the whitespace around the integer. Change it to ...>1974</... and it works.

MichielCM avatar Apr 05 '19 09:04 MichielCM

Doh! I thought I was missing something. Thanks.

kgi-github avatar Apr 06 '19 04:04 kgi-github

You're welcome. Let's leave this one open, because according to the specification, your XML with the whitespace is valid.

MichielCM avatar Apr 07 '19 18:04 MichielCM