<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"
            "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">

<channel>
<title>tclxml-users archive @ ASPN</title>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Browse/Threaded/tclxml-users</link>
<description>Discussion on using the TclXML package</description>
<language>en-us</language>
<copyright>Copyright 2005, ActiveState</copyright>
<managingEditor>aspn-feedback@activestate.com</managingEditor>
<webMaster>aspn-feedback@activestate.com</webMaster>

<image>
<title>tclxml-users @ ASPN Mail Archive</title>
<url>http://ASPN.ActiveState.com/ASPN/img/logo_78x25.gif</url>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Browse/Threaded/tclxml-users</link>
</image>

<item>
<title>Re: [Tclxml-users] TCLXML question</title>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Message/tclxml-users/3141124</link>
<description>&lt;PRE>Hi Jennifer,

You wrote:
>	I am new to the TCLXML package and I am not sure if I can use
> this to also validate an xml document.  I am going be receiving an XML
> documents that I will need to validate against a schema and once it is
> known to be valid I can parse it.  I did see there is a validate  
> command
> that I can use but the explanation is a bit vague and I did not see  
> any
> where I could enter the name of the schema file it would use.   
> Could you
> shed some light on this for me.  If I can not use the TCLXML	
> package to
> validate would I use the TCLDOM package for that?

Hmmm... just checked the TclDOM manual and it looks like I haven't  
documented the validation interface properly(or at all ;-( ).  Please  
submit a documentation bug report on SourceForge.

Firstly, validation is only available when using the libxml2  
implementation.  The pure-Tcl implementation of TclXML does not have  
any kind of validation available.

Secondly, validation must be performed either during parsing of the  
XML document or after the document has been parsed (aka "posteriori  
validation").  There is no concept of validating the document and  
subsequently parsing it.

TclXML/libxml2 and TclDOM/libxml2 both offer validation services.   
With TclXML, validation may be performed during parsing of the	
document.  With TclDOM, validation must be performed after the	
document has been parsed (ie. "posteriori" or "after-the-fact").

When performing DTD validation, the instance XML document declares  
the location of the DTD in its Document Type Declaration.  TclXML is  
able to read the declaration when parsing the document and can then  
go and fetch the (external) DTD (DTDs can also be internal; ie.  
embedded in the instance XML document).  With TclDOM, you can specify  
the DTD subset separately.

When performing XSD validation, the schema document is usually	
specified separately from the instance XML document.  RELAX NG	
validation always specifies the schema document separately.  In these  
cases the schema document is itself an XML document.  Your script  
must first load and parse the schema XML document, and then use it to  
validate the instance XML document.

For an example of how to perform validation of a document, look at  
the tkxmllint application.  The script for this tool is in the	
examples directory of the TclDOM distribution.	In the meantime,  
here's a quick example:

set doc [dom::parse $xml] ;# this is the instance XML document
if {[catch {$doc dtd validate} msg]} {
     puts stderr "document is not valid due to \"$msg\""
} else {
     puts stderr "document is valid"
}

set schemadoc [dom::parse $schemaxml]	;# this is the schema XML document
if {[catch {$schemadoc schema compile} msg]} {
     puts stderr "unable to compile schema doc due to \"$msg\""
     exit 1
}

if {[catch {$schemadoc schema validate $doc} msg]} {
     puts stderr "document is not schema-valid due to \"$msg\""
} else {
     puts stderr "document is schema-valid"
}

Hope that helps,
Steve Ball

---

Steve Ball	      |   XSLT Standard Library   | Training &amp; Seminars
Explain 	|     Web Tcl Complete	    |	XML XSL Schemas
http://www.explain.com.au/ |	  TclXML TclDOM        | Tcl, Web  
Development
Steve.Ball@...	+--------------------------- 
+---------------------
Ph. +61 2 6242 4099   |   Mobile (0413) 594 462   | Fax +61 2 6242 4099



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=107521&amp;bid=248729&amp;dat=121642
_______________________________________________
Tclxml-users mailing list
Tclxml-users@...
https://lists.sourceforge.net/lists/listinfo/tclxml-users
&lt;/PRE></description>
</item>

<item>
<title>[Tclxml-users] TCLXML question</title>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Message/tclxml-users/3140929</link>
<description>&lt;PRE>I am new to the TCLXML package and I am not sure if I can use
this to also validate an xml document.	I am going be receiving an XML
documents that I will need to validate against a schema and once it is
known to be valid I can parse it.  I did see there is a validate command
that I can use but the explanation is a bit vague and I did not see any
where I could enter the name of the schema file it would use.  Could you
shed some light on this for me.  If I can not use the TCLXML package to
validate would I use the TCLDOM package for that?

Any help would be appreciated.

Thank you 
Jennifer
jmirons@... 



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd_______________________________________________
Tclxml-users mailing list
Tclxml-users@...
https://lists.sourceforge.net/lists/listinfo/tclxml-users
&lt;/PRE></description>
</item>

<item>
<title>[Tclxml-users] Bug in TclDOM 3.1</title>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Message/tclxml-users/3122728</link>
<description>&lt;PRE>I have found a bug in TclDOM 3.1 under RHEL
WS 4 Update 3 and ActiveTcl
8.4.12.0 related to node duplication and memory allocation/deallocation.
The following script demonstrates the error:

package require dom
set fid [open $argv r]
set doc1 [dom::parse [read $fid]]
close $fid
dom::trim $doc1
puts [dom::serialize $doc1]
set root1 [dom::document cget $doc1 -documentElement]
set node [dom::selectNode $root1 child::analysis]
set doc2 [dom::create]
set root2 [dom::document createElement $doc2 maxmin]
dom::element setAttribute $root2 analyses 1
dom::element setAttribute $root2 version [dom::element getAttribute
$root1 version]
dom::node appendChild $root2 $node
puts [dom::serialize $doc2]
dom::destroy $doc1
dom::destroy $doc2
exit


Use the following as a data file:

&lt;?xml version="1.0" encoding="utf-8"?>
&lt;maxmin analyses="1" version="1.0">
  &lt;analysis number="1" items="8" variations="1" ID="NL">
    &lt;title>Interface Forces&lt;/title>
    &lt;subtitle>Nominal Landing Manifest Configuration&lt;/subtitle>
    &lt;label>STS-121 VLA-1 IV&amp;V&lt;/label>
  &lt;/analysis>
&lt;/maxmin>

And execute the example as follows:

$ tclsh8.4 test.tcl test.xml
&lt;?xml version="1.0" encoding="utf-8"?>
&lt;maxmin analyses="1" version="1.0">&lt;analysis number="1" items="8"
variations="1" ID="NL">&lt;title>Interface
Forces&lt;/title>&lt;subtitle>Nominal Landing Manifest
Configuration&lt;/subtitle>&lt;label>STS-121 VLA-1
IV&amp;V&lt;/label>&lt;/analysis>&lt;/maxmin>

&lt;?xml version="1.0" encoding="utf-8"?>
&lt;maxmin analyses="1" version="1.0">&lt;analysis number="1" items="8"
variations="1" ID="NL">&lt;title>Interface
Forces&lt;/title>&lt;subtitle>Nominal Landing Manifest
Configuration&lt;/subtitle>&lt;label>STS-121 VLA-1
IV&amp;V&lt;/label>&lt;/analysis>&lt;/maxmin>

*** glibc detected *** free(): invalid pointer: 0x080ca82c ***
Aborted

If you set the environment variable MALLOC_CHECK_=1, you will see that
many attempts are made to free invalid pointers. Experimentation has
isolated the error to appendChild command. As you can see the "new"
document is an exact copy of the original document as it should be. I
suspect that the when the node is removed from the original parent, the
node's document, parent, children, or sibling references are not being
updated properly.

Kevin
-- 
Kevin Partin
(281) 286-8959
mailto:Kevin.Partin@...



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=120709&amp;bid=263057&amp;dat=121642
_______________________________________________
Tclxml-users mailing list
Tclxml-users@...
https://lists.sourceforge.net/lists/listinfo/tclxml-users
&lt;/PRE></description>
</item>

<item>
<title>Re: [Tclxml-users] working dom example for tclxml3.1 anywhere?</title>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Message/tclxml-users/2987212</link>
<description>&lt;PRE>Ben,

I did some work on the domtree example last year to make it work with  
tktreectrl, see examples/domtree-treectrl.tcl (display of the  
document tree works, but I haven't hooked up the DOM events yet).   
Although I use the binary installation of TclXML (ie. w/- libxml2), I  
don't recall there being anything in there that wouldn't work with  
the Tcl implementation.

With some limitations, the tkxmllint application should work with  
TclDOM/tcl.  It won't be able to perform DTD/XSD/RNG validation, but  
the basic read-file/parse/serialise operation should work.

Also, there's always the test suite.  Tests are marked as whether  
they are specific to a particular parser, but most of them apply to  
all implementations.

Now, both TclXML/TclDOM packages are meant to be API compatible so  
this shouldn't be an issue (modulo unsupported features, like  
validation, XPath, etc).  If there are examples in the distribution  
that don't work with v3.1 then please report that as a bug on SF.

Finally, if you need help with TclXML and/or TclDOM then please  
either write to the list or to me directly and let us know what you  
are trying to do.  Anyone on the list, or myself in particular, can  
then respond.  Anyone should feel free to add the responses to a Wiki  
page.

HTHs,
Steve Ball

---

Steve Ball	      |   XSLT Standard Library   | Training &amp; Seminars
Explain 	|     Web Tcl Complete	    |	XML XSL Schemas
http://www.explain.com.au/ |	  TclXML TclDOM        | Tcl, Web  
Development
Steve.Ball@...	+--------------------------- 
+---------------------
Ph. +61 2 6242 4099   |   Mobile (0413) 594 462   | Fax +61 2 6242 4099


On 20/01/2006, at 4:04 AM, Benjamin Allan wrote:

>
>
> I'm desperately trying to find a working detailed example of
> tcldom usage for the current tclxml3.1 based distribution.
> The demos I find provided in the installation (domtree etc)
> all seem to require either one of the binary xml parsers
> or v 2.5 of the xml or dom packages. Does anyone have some
> code to share based on tclxml3.1 and the pure tcl parser?
>



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=103432&amp;bid=230486&amp;dat=121642
_______________________________________________
Tclxml-users mailing list
Tclxml-users@...
https://lists.sourceforge.net/lists/listinfo/tclxml-users
&lt;/PRE></description>
</item>

<item>
<title>[Tclxml-users] working dom example for tclxml3.1 anywhere?</title>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Message/tclxml-users/2986100</link>
<description>&lt;PRE>I'm desperately trying to find a working detailed example of
tcldom usage for the current tclxml3.1 based distribution.
The demos I find provided in the installation (domtree etc)
all seem to require either one of the binary xml parsers
or v 2.5 of the xml or dom packages. Does anyone have some
code to share based on tclxml3.1 and the pure tcl parser?

thanks,

Ben



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=103432&amp;bid=230486&amp;dat=121642
_______________________________________________
Tclxml-users mailing list
Tclxml-users@...
https://lists.sourceforge.net/lists/listinfo/tclxml-users
&lt;/PRE></description>
</item>

<item>
<title>[Tclxml-users] tcldom/tclxml pure tcl examples for 3.1?</title>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Message/tclxml-users/2984751</link>
<description>&lt;PRE>I'm desperately trying to find a working detailed example of
tcldom usage for the current tclxml3.1 based distribution.
The demos I find provided in the installation (domtree etc)
all seem to require either one of the binary xml parsers
or v 2.5 of the xml or dom packages. Does anyone have some
code to share based on tclxml3.1 and the pure tcl parser?

thanks,

Ben


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&amp;kid=103432&amp;bid=230486&amp;dat=121642
_______________________________________________
Tclxml-users mailing list
Tclxml-users@...
https://lists.sourceforge.net/lists/listinfo/tclxml-users
&lt;/PRE></description>
</item>

<item>
<title>Re: [Tclxml-users] [ANN]: VTD-XML 1.0 released</title>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Message/tclxml-users/2860468</link>
<description>&lt;PRE>so, does it actually have a Tcl API?   That would be useful (to know).

hh


Jimmy zhang wrote:

> I am pleased to announce that both Java and C version 1.0 of
> VTD-XML -- an open-source, high-performance and non-extractive
> XML processing API -- is freely available on sourceforge.net.
> For source code, documentation, detailed description of API
> and code examples, please visit ...




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Tclxml-users mailing list
Tclxml-users@...
https://lists.sourceforge.net/lists/listinfo/tclxml-users
&lt;/PRE></description>
</item>

<item>
<title>[Tclxml-users] [ANN]: VTD-XML 1.0 released</title>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Message/tclxml-users/2860322</link>
<description>&lt;PRE>I am pleased to announce that both Java and
C version 1.0 of
VTD-XML -- an open-source, high-performance and non-extractive
XML processing API -- is freely available on sourceforge.net.
For source code, documentation, detailed description of API
and code examples, please visit

  http://vtd-xml.sourceforge.net

New in VTD-XML 1.0 is the integrated support of XPath that also
features a easy-to-use interface that further enhances VTD-XML's
inherent benefits, such as CPU/memory efficiency, random access,
and incremental update. A demo of the XPath capability is available
at

  http://vtd-xml.sourceforge.net/demo.html

For further reading, please refer to the following articles about
VTD-XML

* Process SOAP with VTD-XML
  http://xml.sys-con.com/read/48764.htm

* Better, faster XML processing with VTD-XML
  http://www.devx.com/xml/Article/22219?trk=DXRSS_XML

* XML on a chip
  http://www.xml.com/pub/a/2005/03/09/chip.html

* Improve XML processing with VTD-XML
  http://www.intel.com/cd/ids/developer/asmo-na/eng/dc/xeon/multicore/211657.htm







-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Tclxml-users mailing list
Tclxml-users@...
https://lists.sourceforge.net/lists/listinfo/tclxml-users
&lt;/PRE></description>
</item>

<item>
<title>[Tclxml-users] Incremental parsing</title>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Message/tclxml-users/2826047</link>
<description>&lt;PRE>Hi,


I'm trying to get the hang of [xml::parser -final 0] for
incremental parsing, with little luck :-(.

Has anyone used this with the pure Tcl parser (3.0)? I'm getting
parse errors with incremental, but no errors without.


Incremental:
====
package require xml

set parser [xml::parser -final 0 -errorcommand xerror]

proc xerror args {
    puts "xerror: $args"
}

$parser parse {&lt;one x="5">hello world&lt;/one>}
$parser configure -final 1
$parser parse \n
====

gives:
xerror: unexpectedtext {unexpected text " x="5"" in document prolog around line 0}


while setting "-final 1" instead and
====
$parser parse {&lt;one x="5">hello world&lt;/one>
}
====

works as expected.


Thanks,
Ian Braithwaite



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Tclxml-users mailing list
Tclxml-users@...
https://lists.sourceforge.net/lists/listinfo/tclxml-users
&lt;/PRE></description>
</item>

<item>
<title>[Tclxml-users] using xsd to validate xml in tcl applications</title>
<link>http://ASPN.ActiveState.com/ASPN/Mail/Message/tclxml-users/2797442</link>
<description>&lt;PRE>Hi,

I'm a newbie to xml and am looking for some advice on validating the xml 
produced. 

At the moment I'm using xmlgen to write out the XML from my tcl 
application.  Whilst I
understand that xmlgen is guaranteed to produce well-formed XML I need 
to be sure
that the XML is valid before it is saved.  Is there a way in tcl to 
validate the XML against
the XSD?

I'm also wondering whether I would be better off using tclDOM?	The 
nesting of the XML
is quite deep and the amount of data pretty big. 

Thanks for you help.
Rosalyn.

-- 
------------------------------------------------------------------------
Rosalyn Hatcher
CGAM, Dept. of Meteorology, University of Reading, 
Earley Gate, Reading. RG6 6BB
Email: r.s.hatcher@...	   Tel: +44 (0) 118 378 7841



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference &amp; EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile &amp; Plan-Driven Development * Managing Projects &amp; Teams * Testing &amp; QA
Security * Process Improvement &amp; Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Tclxml-users mailing list
Tclxml-users@...
https://lists.sourceforge.net/lists/listinfo/tclxml-users
&lt;/PRE></description>
</item>

</channel>
</rss>