473,511 Members | 16,258 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create HTML Form from Schema using xql or xslt?

Hi Guys,

I have a need to create a html form based on my schema. I initially
decided to do this using xql, have got some way but am finding this
difficult (it may be as I am very new to xql).
The html form needs to be dynamically generated from the schema as the
schema may change in future. We need the forms to provide a UI for users
to edit the underlying xml documents represented by the schema.

Im wandering if there is an easy way or if its even possible to do it
using xslt instead?

I have attached my Schemas and xql for you guys to see what ive done so
far. Basically ive managed to generate some text fields for my text
elements in my schema but they are out of order and im not sure how to
deal with elements that have simple and complex types. Ideally for a
enumeration I would like to display a combo-box with all the possible
values of the enumeration.

Any hints and tips with xql, or an xslt method or anything else will be
greatly appreciated.
Thanks
Adam Retter

ad*********@devon.gov.uk

xquery version "1.0";
(:for $cg in doc("/db/CommunityDatabase/CommunityGroup.xsd")/xs:schema/xs:element/xs:complexType/xs:sequence//xs:element return:)
for $cg in doc("/db/CommunityDatabase/CommunityGroup.xsd")/xs:schema//xs:element return
let $pi := $cg/@type return
if($pi eq "xs:string") then
(: OUTPUT text field :)
if($cg/../../@name) then
<input type="text" group="{$cg/../../@name}">{$cg/@name}</input>
else
<input type="text">{$cg/@name}</input>
else(
if($pi eq "xs:integer") then
(: OUTPUT integer field :)
<p>{$cg/@name}</p>
else(

)
)
(:
for $txt in doc("/db/CommunityDatabase/CommunityGroup.xsd")/xs:schema/xs:element/xs:complexType/xs:sequence//xs:element[@type="xs:string"] return
<input type="text">{$txt/@name}</input>

for $inte in doc("/db/CommunityDatabase/CommunityGroup.xsd")/xs:schema/xs:element/xs:complexType/xs:sequence//xs:element[@type="xs:integer"] return
<p>{$inte/@name}</p>
:)

Jul 20 '05 #1
0 2163

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1667
by: ChronicFatigue | last post by:
Have read some basic tutorials on xml and understand that xml is a markup language used to describe data using tags which can be defined by the user. Am about to start work on a content rich...
6
2476
by: Pieter | last post by:
I've read a lot of posts on "why relax ng is so very good" and on "why w3c xml schema should be the only schema language". I'm, however, still not clear on why I should prefer one over the other. ...
7
2911
by: Ed Lai | last post by:
A few weeks ago I have the idea of converting XML instance data to a HTML form, using tags as the label and the resulting form can be used to edit the XML data. So I started to play around with it,...
2
10682
by: Michael Hertz | last post by:
Assume there is a XSD schema which describes the maximum possible number of fields which can occur in a XML document. How do I create such a form either as a HTML form or a text file from the XSD...
5
3755
by: Donald Firesmith | last post by:
Are html tags allowed within meta tags? Specifically, if I have html tags within a <definition> tag within XML, can I use the definition as the content within the <meta content="description> tag? ...
3
5901
by: Davide Bedin | last post by:
I have a "library" schema with the simple and complex types I commonly use in other schemas and then several other schemas, maybe created by other developers, that import/include the library...
0
1253
by: marcum williams | last post by:
Below I'm generating an updategram via xslt and currently referencing schema via <updg:sync mapping-schema="hpXSD.xsd"> .... </updg:sync> But I would like to LOAD the .xsd schema into memory...
2
9074
by: David Elliott | last post by:
I can create this: ?xml version="1.0" standalone="yes" ?> <ConfigOpt> <record> <Field_1>Text # 1</Field_1> <Field_2>Text # 2</Field_2> </record> </ConfigOpt>
6
2559
by: Martin | last post by:
Hi, I have a xml file like the one below <?xml version="1.0" encoding="utf-8"?><e1 xmlns:e1="http://tempuri.org/Source1.xsd" e1:att1="1" e1:att2="2" e1:rest="345"/> If I try to create a...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7418
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7508
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3212
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
446
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.