Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Indenting with XHTML

Reply
Thread Tools

Indenting with XHTML

 
 
John
Guest
Posts: n/a
 
      09-09-2004
Hi,

I need to produce XHTML (transitional or strict) documents, that display
invoices. A typical invoice might be:

1 x Assembled Part
consisting of ...
5 x Large Bolt
10 x Small Bolt
3 x Assembly 452
consisting of ...
1 x Mending Plate
3 x Self-Tapping Screw
3 x Bottle of Oil
5 x Toolkit A
consisting of ...
1 x Spanner
1 x Hammer
1 x Stapler

What is the best (most standards-compliant and clean coded) way to
format this list in XHTML? I am open to all suggestions (not just those
that look like the above). The indentation works well at displaying the
nesting, but there could well be other better ways. This document will
be non-geek viewable though, so nested brackets and such like are out of
the question.

Cheers,

John


 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      09-09-2004
John
> Hi,


Er, G'day. Care for some chardonnay?

> I need to produce XHTML


Why the emphasis on XHTML. HTML will do nicely until the majority of
browsers in use support XHTML (hint IE does not, really).

> (transitional or strict)


I would hope that new documents would validate to strict.

> documents, that display
> invoices. A typical invoice might be:
>
> 1 x Assembled Part
> consisting of ...
> 5 x Large Bolt
> 10 x Small Bolt
> 3 x Assembly 452
> consisting of ...
> 1 x Mending Plate
> 3 x Self-Tapping Screw
> 3 x Bottle of Oil
> 5 x Toolkit A
> consisting of ...
> 1 x Spanner
> 1 x Hammer
> 1 x Stapler



> What is the best (most standards-compliant and clean coded) way to
> format this list in XHTML? I am open to all suggestions (not just those
> that look like the above). The indentation works well at displaying the
> nesting, but there could well be other better ways.


This is unordered lists within unordered lists. You may have to adjust the
decoration and the margins to suit.

> This document will
> be non-geek viewable though, so nested brackets and such like are out of
> the question.


Er, what does this actually mean? What brackets and what geeks?

--
Cheers
Richard.


 
Reply With Quote
 
 
 
 
John
Guest
Posts: n/a
 
      09-09-2004
rf wrote:

> John
>
>>Hi,

>
>
> Er, G'day. Care for some chardonnay?


I'll give it a miss, thanks anyway.

>
>
>>I need to produce XHTML

>
>
> Why the emphasis on XHTML. HTML will do nicely until the majority of
> browsers in use support XHTML (hint IE does not, really).


To allow other systems to read the documents (specified feature I can't
control).

>
>
>>(transitional or strict)

>
>
> I would hope that new documents would validate to strict.


Good.

>
>
>>documents, that display
>>invoices. A typical invoice might be:
>>
>>1 x Assembled Part
>>consisting of ...
>> 5 x Large Bolt
>> 10 x Small Bolt
>> 3 x Assembly 452
>> consisting of ...
>> 1 x Mending Plate
>> 3 x Self-Tapping Screw
>>3 x Bottle of Oil
>>5 x Toolkit A
>>consisting of ...
>> 1 x Spanner
>> 1 x Hammer
>> 1 x Stapler

>
>
>
>>What is the best (most standards-compliant and clean coded) way to
>>format this list in XHTML? I am open to all suggestions (not just those
>>that look like the above). The indentation works well at displaying the
>>nesting, but there could well be other better ways.

>
>
> This is unordered lists within unordered lists. You may have to adjust the
> decoration and the margins to suit.


Right, I'll have a go at those. I'm not sure about adjusting the margins
though, how would that work?

>
>
>>This document will
>>be non-geek viewable though, so nested brackets and such like are out of
>>the question.

>
>
> Er, what does this actually mean? What brackets and what geeks?


If I was writing it for myself I might just use brackets.

Order_4673{
5 x ToolKit_A{
1 x Spanner
1 x Hammer
1 x Stapler
}
}

>


Cheers for the response rf.

John
 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      09-09-2004
John wrote:

> 1 x Assembled Part
> consisting of ...
> 5 x Large Bolt
> 10 x Small Bolt
> 3 x Assembly 452
> consisting of ...
> 1 x Mending Plate
> 3 x Self-Tapping Screw
> 3 x Bottle of Oil
> 5 x Toolkit A
> consisting of ...
> 1 x Spanner
> 1 x Hammer
> 1 x Stapler


<style type="text/css">
.partslist li {
list-style: none;
}
</style>
<ul class="partslist">
<li>
1 x Assembled Part<br />
consisiting of...
<ul>
<li>5 x Large Bolt</li>
<li>10 x Small Bolt</li>
<li>
3 x Assembly 452<br />
consisting of...
<ul>
<li>1 x Mending Plate</li>
<li>3 x Self-Tapping Screw</li>
</ul>
</li>
</ul>
</li>
<li>3 x Bottle of Oil</li>
<li>
5 x Toolkit A<br />
consisting of...
<ul>
<li>1 x Spanner</li>
<li>1 x Hammer</li>
<li>1 x Stapler</li>
</ul>
</li>
</ul>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Frogleg
Guest
Posts: n/a
 
      09-09-2004
On Thu, 09 Sep 2004 10:54:22 +0100, Toby Inkster
<(E-Mail Removed)> wrote:

>John wrote:
>
>> 1 x Assembled Part
>> consisting of ...
>> 5 x Large Bolt
>> 10 x Small Bolt

<snip>
><style type="text/css">
> .partslist li {
> list-style: none;
> }
></style>
><ul class="partslist">
> <li>
> 1 x Assembled Part<br />
> consisiting of...
> <ul>
> <li>5 x Large Bolt</li>
> <li>10 x Small Bolt</li>
> <li>

<snip>

What about <dl> and <dd>/<dt>? I remember being entranced with dl's
when I first began to learn HTML, but I rarely see them/anything about
them now.
 
Reply With Quote
 
Karl Groves
Guest
Posts: n/a
 
      09-09-2004

"Frogleg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> What about <dl> and <dd>/<dt>? I remember being entranced with dl's
> when I first began to learn HTML, but I rarely see them/anything about
> them now.


Is the OP's list a list of terms and their definitions? No. So, it wouldn't
be appropriate here.

-Karl


 
Reply With Quote
 
Ken
Guest
Posts: n/a
 
      09-09-2004
Hi Karl -

On Thu, 9 Sep 2004 07:16:47 -0400, "Karl Groves"
<(E-Mail Removed)> wrote:

>"Frogleg" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed).. .
>
>> What about <dl> and <dd>/<dt>? I remember being entranced with dl's
>> when I first began to learn HTML, but I rarely see them/anything about
>> them now.

>
>Is the OP's list a list of terms and their definitions? No. So, it wouldn't
>be appropriate here.


Actually the OP's list *IS* a list of terms (parts) and their
definitions (components).

I'm not saying that's the best way to do it or the way that I would
recommend (I'm not making any particular recommendation), but it is
one valid possibility.

--
Ken
http://www.ke9nr.net/
 
Reply With Quote
 
Karl Groves
Guest
Posts: n/a
 
      09-09-2004

"Ken" <ng3122@ke9nr.#nospam#.net> wrote in message
news:(E-Mail Removed)...
> Hi Karl -
>
> On Thu, 9 Sep 2004 07:16:47 -0400, "Karl Groves"
> <(E-Mail Removed)> wrote:
>
> >"Frogleg" <(E-Mail Removed)> wrote in message
> >news:(E-Mail Removed).. .
> >
> >> What about <dl> and <dd>/<dt>? I remember being entranced with dl's
> >> when I first began to learn HTML, but I rarely see them/anything about
> >> them now.

> >
> >Is the OP's list a list of terms and their definitions? No. So, it

wouldn't
> >be appropriate here.

>
> Actually the OP's list *IS* a list of terms (parts) and their
> definitions (components).
>


I don't view that as a definition at all.
A definition list is a list of terms and what those terms mean.
A part, listed with its components seems more appropriately handled with a
table or an unordered list.

-Karl


 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      09-09-2004
Toby Inkster <(E-Mail Removed)> wrote:

> 1 x Assembled Part


I would suggest using the multiplication sign "" instead of the letter
"x" in such expressions. Looks more professional. If you don't know how
to type the multiplication sign on your keyboard (Alt-0215 works in most
Windows programs), use the entity reference &times;, e.g.
1 &times; Assembed Part

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
Sam Hughes
Guest
Posts: n/a
 
      09-10-2004
John <no@email> wrote in news:41402776$0$22755$(E-Mail Removed):

> rf wrote:
>
>> John wrote:
>>
>>>documents, that display
>>>invoices. A typical invoice might be:
>>>
>>>1 x Assembled Part
>>>consisting of ...
>>> 5 x Large Bolt
>>> 10 x Small Bolt
>>> 3 x Assembly 452
>>> consisting of ...
>>> 1 x Mending Plate
>>> 3 x Self-Tapping Screw
>>>3 x Bottle of Oil
>>>5 x Toolkit A
>>>consisting of ...
>>> 1 x Spanner
>>> 1 x Hammer
>>> 1 x Stapler

>>
>>
>>
>>>What is the best (most standards-compliant and clean coded) way to
>>>format this list in XHTML? I am open to all suggestions (not just
>>>those that look like the above). The indentation works well at
>>>displaying the nesting, but there could well be other better ways.

>>
>>
>> This is unordered lists within unordered lists. You may have to
>> adjust the decoration and the margins to suit.

>
> Right, I'll have a go at those. I'm not sure about adjusting the
> margins though, how would that work?


If you wanted to adjust the margins, you could use a little CSS.
However, since most browsers (read: all) progressively indent nested
lists in that manner by default, you wouldn't need to do so. I would
mark up the information like this:

<ul>
<li>1 x Assembled Part<br>
consisting of ...
<ul>
<li>5 x Large Bolt</li>
<li>10 x Small Bolt</li>
<li>3 x Assembly 452<br>
consisting of ...
<ul>
<li>1 x Mending Plate</li>
<li>3 x Self-Tapping Screw</li>
</ul>
</li>
</ul>
</li>
<li>3 x Bottle of Oil</li>
<li>5 x Toolkit A<br>
consisting of ...
<ul>
<li>1 x Spanner</li>
<li>1 x Hammer</li>
<li>1 x Stapler</li>
</ul>
</li>
</ul>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and indenting XML files Harrie XML 6 03-01-2006 11:59 AM
Indenting INPUT Yama ASP .Net 1 11-14-2005 01:04 PM
Indenting text from an arraylist... RAB ASP .Net 2 11-06-2005 02:16 AM
indenting dropDownList items when pulling from XML Darrel ASP .Net 2 10-31-2004 01:53 AM
Missing xmlns attribute while indenting using xalan (JAVA) Hyunchan Kim XML 1 12-18-2003 11:12 AM



Advertisments