473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Attributes in closing tags?

Hello,

I am planning to use XML in a log file for an application I am writing. The
format will be something like:

<task date="2003-10-09" time="12:03:45">
<action type="action1" timetaken="4" />
<action type="action2" timetaken="4" />
<action type="action3" timetaken="4" />
</task duration="12">

Is this legal XML? Are you allowed attributes in closing tags? (the
"duration" attribute for example). If not, how can I produce output similar
to this which is valid XML - bearing in mind that the total time taken for
a "task" will not be known until each "action" has completed. Also, it is
not guaranteed that the task duration will be equal to the sum of the
action durations.

Many thanks in advance,

Ian Partridge

--
Remove "DIESPAM" to reply.
Jul 20 '05 #1
3 1599
Hi Ian,

No, you cannot include any attributes in closing tags unfortunately.
However, since you only know the duration after all the <action>s have been
processed, you could get away with sticking a last <duration> child node
into the <task> node. Without knowing more of the details of what you are
doing, I cannot offer better help. Still, I hope the above helps you get
moving.

Kimanzi Mati
www.emergentlogic.com

"Ian Partridge" <i.*********@DIESPAM.uk.ibm.com> wrote in message
news:Xn********************************@9.20.142.8 ...
Hello,

I am planning to use XML in a log file for an application I am writing. The format will be something like:

<task date="2003-10-09" time="12:03:45">
<action type="action1" timetaken="4" />
<action type="action2" timetaken="4" />
<action type="action3" timetaken="4" />
</task duration="12">

Is this legal XML? Are you allowed attributes in closing tags? (the
"duration" attribute for example). If not, how can I produce output similar to this which is valid XML - bearing in mind that the total time taken for
a "task" will not be known until each "action" has completed. Also, it is
not guaranteed that the task duration will be equal to the sum of the
action durations.

Many thanks in advance,

Ian Partridge

--
Remove "DIESPAM" to reply.

Jul 20 '05 #2
Hi,

Yes, of course that would be possible. I feel very stupid now!

Thanks for pointing that out.

Ian

"Kimanzi Mati" <ma****@emergentlogic.com> wrote in
news:ksahb.29642$k74.13613@lakeread05:
Hi Ian,

No, you cannot include any attributes in closing tags unfortunately.
However, since you only know the duration after all the <action>s have
been processed, you could get away with sticking a last <duration>
child node into the <task> node. Without knowing more of the details
of what you are doing, I cannot offer better help. Still, I hope the
above helps you get moving.

Kimanzi Mati
www.emergentlogic.com

"Ian Partridge" <i.*********@DIESPAM.uk.ibm.com> wrote in message
news:Xn********************************@9.20.142.8 ...
Hello,

I am planning to use XML in a log file for an application I am
writing.

The
format will be something like:

<task date="2003-10-09" time="12:03:45">
<action type="action1" timetaken="4" />
<action type="action2" timetaken="4" />
<action type="action3" timetaken="4" />
</task duration="12">

Is this legal XML? Are you allowed attributes in closing tags? (the
"duration" attribute for example). If not, how can I produce output

similar
to this which is valid XML - bearing in mind that the total time
taken for a "task" will not be known until each "action" has
completed. Also, it is not guaranteed that the task duration will be
equal to the sum of the action durations.

Many thanks in advance,

Ian Partridge

Jul 20 '05 #3
Glad to be of service... :)

"Ian Partridge" <i.*********@DIESPAM.uk.ibm.com> wrote in message
news:Xn********************************@9.20.142.8 ...
Hi,

Yes, of course that would be possible. I feel very stupid now!

Thanks for pointing that out.

Ian

"Kimanzi Mati" <ma****@emergentlogic.com> wrote in
news:ksahb.29642$k74.13613@lakeread05:
Hi Ian,

No, you cannot include any attributes in closing tags unfortunately.
However, since you only know the duration after all the <action>s have
been processed, you could get away with sticking a last <duration>
child node into the <task> node. Without knowing more of the details
of what you are doing, I cannot offer better help. Still, I hope the
above helps you get moving.

Kimanzi Mati
www.emergentlogic.com

"Ian Partridge" <i.*********@DIESPAM.uk.ibm.com> wrote in message
news:Xn********************************@9.20.142.8 ...
Hello,

I am planning to use XML in a log file for an application I am
writing.

The
format will be something like:

<task date="2003-10-09" time="12:03:45">
<action type="action1" timetaken="4" />
<action type="action2" timetaken="4" />
<action type="action3" timetaken="4" />
</task duration="12">

Is this legal XML? Are you allowed attributes in closing tags? (the
"duration" attribute for example). If not, how can I produce output

similar
to this which is valid XML - bearing in mind that the total time
taken for a "task" will not be known until each "action" has
completed. Also, it is not guaranteed that the task duration will be
equal to the sum of the action durations.

Many thanks in advance,

Ian Partridge

Jul 20 '05 #4

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

Similar topics

3
by: Jean-Fran?ois Lacrampe | last post by:
Hello, I want to write a _very_ simple text parser that would replace a string like: "This is text with /italics/, *bold* and _underline_." and generate automatically something like this: ...
2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
12
by: Oberon | last post by:
I have a large HTML document. It has hundreds of <span>s which have no attributes so these <span>s are redundant. How can I remove these tags automatically? The document also has <span>s with...
2
by: Nathan Sokalski | last post by:
I have a section in my ASP.NET code where I have an HTML unordered list. Visual Studio keeps removing the closing list item tags, except for the last list item. In other words, Visual Studio makes...
1
by: Randall Parker | last post by:
I'm wondering if there are general rules for the use of HTML attributes with ASP tags? For example, one can set an id for an asp:DataGrid and it will show up as the id for the resulting HTML...
6
by: Jakub.Bednarczuk | last post by:
Hallo everybody I have the problem with getting attributes values and also attributes names. I am reading an xml file with DOM. Lets see an example: file I read <root> <Def></Def>...
3
by: apiringmvp | last post by:
All, So I am creating a function that gets a short blurb of html from a blog. I would like to retain all html formating and images. The code below works well, with the exception of one issue....
1
by: WestyCHC | last post by:
Morning all from a newbie. I have recently written an automation program (my first ever program) for testing and now I am trying to read XML data and assign the values to variables (rather than...
1
by: Nathan Sokalski | last post by:
I am using the System.Web.UI.HtmlTextWriter, and would like to create tags that are self-closing (such as <tagname />). The RenderBeginTag method does not offer the option of making a self-closing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.