beginner guide

M

mick

hello,
I need to learn enough xml to use a piece of software. can anybody
point me to a friendly guide. right now I want to know exactly what a
placeholder is. I kind of understand but not really .

thanks

mick
 
P

Peter Flynn

mick said:
hello,
I need to learn enough xml to use a piece of software. can anybody
point me to a friendly guide. right now I want to know exactly what a
placeholder is. I kind of understand but not really .

The term placeholder isn't specific to XML: it's used in a lot of
computing and non-computing fields.

You haven't told us what the piece of software is that you want to use,
but in most document contexts I have come across, "placeholder" means an
empty element or attribute (or one with a temporary value) which must be
present to satisfy the constraints of the Schema or DTD, but which does
not yet have any real value or content.

For example, in DocBook, a chapter must have a title and at least one
other element present for the document to be valid, so you might want to
create dummy entries for your intended chapters, but with no content, eg

<chapter id="xyz">
<title></title>
<para></para>
</chapter>

(although it would be more likely that you would give the titles: that
would at least enable you to generate the Table of Contents). In this
sense, the para element is a placeholder, so is the ID value.

///Peter
 
P

Peter Flynn

mick said:
http://groups.google.co.uk/group/krpano/browse_thread/thread/cf3ad38936eb97f7?hl=en

Those guys will answer eventually I'm sure but I need to get on.

To answer your first question there, the two documents:

<image type="SPHERE"
tiled="true"
tiledimagewidth="8192"
tiledimageheight="4096"
tilesize="1024"
<sphere url="sphere_tiles_%v_%u.jpg" />
</image>

and

<image>
<type>SPHERE</type>
<tiled>true</tiled>
<tiledimagewidth>8192</tiledimagewidth>
<tiledimageheight>4096</tiledimageheight>
<tilesize>1024</tilesize>
<sphere>
<url>sphere_tiles_%v_%u.jpg</url>
</sphere>
</image>

are equivalent but not "the same". That is, they describe the
information with the same names, but using a different syntax.

See the XML FAQ at http://xml.silmaril.ie/developers/attributes/ for
more on using attributes vs elements. My own rule is that numerical and
categorical data is best held in attributes, while normal text is best
held in elements, so I would prefer the first method for this data; but
there are probably many people who will disagree.

But you say that the Krpano docs say (on the first page of docs) "use
proper xml syntax". That's a different question. They must first tell
you what they mean by "proper".

XML can be used (and abused) for almost anything. The only sensible
meaning for "proper" here is "well-formed"; the rules for this are in
the XML Spec and are summarised in the XML FAQ at
http://xml.silmaril.ie/developers/validity/#wf

However, abuse of terminology is also rife, so Krpano may mean "XML
valid according to our Schema or DTD", which is one step further than
well-formedness. Valid documents are not only well-formed; they must
adhere to the specified structure and naming set out in a particular
Schema or DTD.

It is very rare that you are allowed just to make up your own XML and
expect some random application automagically to know what it means, so
you should check with the Krpano people as to what the "proper" XML is.
It appears from the thread you quote that there is already some
specified set of names (image, sphere, etc) that you are aware of, so
you presumably already know what you must use.

///Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top