Re: [xml] xml Digest, Vol 54, Issue 16, Subscription

From: xml-request gnome org
Subject: xml Digest, Vol 54, Issue 16
To: xml gnome org
Date: Fri, 17 Oct 2008 11:52:08 +0000

Send xml mailing list submissions to
      xml gnome org

To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to
      xml-request gnome org

You can reach the person managing the list at
      xml-owner gnome org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of xml digest..."

Today's Topics:

   1. truncated bytes in xml (Prashant R)
   2. [patch] add a --disable-rebuild-docs configure option
      (Adrian Bunk)
   3. SetObjectValue (Apparao Mulpuri)
   4. SAX Parsing continues though namespace constaint is violated
      (Rabi Narayan Sahoo)


Message: 1
Date: Thu, 16 Oct 2008 16:39:05 -0700
From: "Prashant R" 
Subject: [xml] truncated bytes in xml
To: xml gnome org
Content-Type: text/plain; charset="utf-8"

Hi ,

I am  using libxml2 in an embedded environment .
I am trying to use the xmlwriter API's to write xml.

some of the blocks have a sizeable amount of data (>1000 bytes ) .
I am using code similar to this to write each node

xmlNodePtr pDom ;





xmlTextWriterStartElement(writer,(const xmlChar *)kElem1);

xmlTextWriterWriteString(writer , BAD_CAST GetData() ); // line 2


// 2nd element

// 3rd element



//write out xml to file system

xmlOutputBufferPtr buffptr= xmlOutputBufferCreateIO
(WriteCallbackFunction,CloseCallbackFunction, (void *)&file, NULL);

if(buffptr == NULL)

return false ;

// Buffer Ptr ,doc , currentnode , level , format , encoding

xmlNodeDumpOutput(buffptr, pDom->doc, pDom , 0,  0, NULL);


return true;

the problem is that  data  is missing in the final xml file.

Part of the data for Node 1 is written but the rest of the nodes are absent

something like

I have tried replacing the xmlTextWriterWriteString   with other similars
API's such as xmlTextWriterWriteRaw and xmlTextWriteWriteBase64 but havent
had any success !

Is anyone aware of any issues with this or a recommendation for a better way
to do this .

-------------- next part --------------
An HTML attachment was scrubbed...


Message: 2
Date: Fri, 17 Oct 2008 13:11:03 +0300
From: Adrian Bunk 
Subject: [xml] [patch] add a --disable-rebuild-docs configure option
To: xml gnome org
Content-Type: text/plain; charset=utf-8

The Matrix tool [1] used in the ARM Linux Internet Platform [2] checks 
during builds whether shipped files have changed since the last build. 
This catches situations where people forgot to push local changes to the 
repository. It is very uncommon that software modifies shipped files 
during the build. Unfortunately, documentation files shipped in the 
libxml2 SVN get rebuild during a normal build.


With --disable-rebuild-docs shipped files will no longer change during 
the build.

By default, the files will still get rebuilt.

--- a/
+++ b/
@@ -166,6 +166,10 @@ AC_ARG_WITH(zlib,
 [  --with-coverage         build for code coverage with GCC (off)])
+[  --enable-rebuild-docs[[=yes/no]]  rebuild some generated docs [[default=yes]]])
+AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "no"])
 dnl hard dependancies on options
--- a/doc/
+++ b/doc/
@@ -26,7 +26,11 @@ EXTRA_DIST=xmlcatalog_man.xml tutorial/*.html tutorial/*.c tutorial/*.pdf \
 man_MANS = xmllint.1 xmlcatalog.1
 all: web $(top_builddir)/NEWS libxml2.xsa $(man_MANS)
 api: libxml2-api.xml libxml2-refs.xml $(APIPAGES) $(srcdir)/html/index.html $(WIN32_DIR)/libxml2.def.src 


Message: 3
Date: Fri, 17 Oct 2008 16:06:34 +0530
From: "Apparao Mulpuri" 
Subject: [xml] SetObjectValue
To: xml gnome org
Content-Type: text/plain; charset=ISO-8859-1


   I am writing libxml equivalent for NSXML classes. I am struck at
following method implementation:

- (void)setObjectValue:(id)value

Here is the description of the above method:

This method can only be invoked on NSXMLNode objects that may have
content, specifically elements, attributes, namespaces, processing
instructions, text, and DTD-declaration nodes. The given object is
usually a Foundation equivalent to one of the atomic types in the
XQuery data model: NSNumber (integer, decimal, float, double,
Boolean), NSString (string), NSCalendarDate (date), NSData
(base64Binary and hexBinary), NSURL (URI), and NSArray (NMTOKENS,
IDREFS, ENTITIES). However, you can also set the object value to be a
custom value and register a value transformer (that is, an instance of
NSValueTransformer) to convert the object value to an XML string
representation when the node is asked for its string value. Setting a
node's object value removes all existing children, including
processing instructions and comments. Setting an element node's object
value creates a text node as the sole child. When an NSXMLNode object
emits its object-value contents as a string, and it can determine the
type of the value, it ensures that it the string is in a canonical
form as defined by the W3C XML Schema Data Types specification.

Could you please provide some pointers on " How to implement same
Equivalent by using LibXML"?

- Apparao.


Message: 4
Date: Fri, 17 Oct 2008 17:21:37 +0530
From: Rabi Narayan Sahoo 
Subject: [xml] SAX Parsing continues though namespace constaint is
To: xml gnome org
Cc: ashutosh_p huawei com, ranjit huawei com
Content-Type: text/plain; charset="us-ascii"



While parsing the following xml file with SAX Parsing I receive all the SAX
Event though it does not satisfy the namespace specification

In the above file ns1 is not declared which violates the Namespace

"The namespace prefix, unless it is xml or xmlns, MUST have been declared in
a namespace declaration attribute in either the start-tag of 

the element where the prefix is used or in an ancestor element"

Libxml simply gives the warning and continues to give SAX events. 

My question is why violation of this constraint is considered as a warning
not as a fatal error?

Thanks and Regards





-------------- next part --------------
An HTML attachment was scrubbed...


xml mailing list
xml gnome org

End of xml Digest, Vol 54, Issue 16

Hol dir 30 kostenlose Emoticons für deinen Windows Live Messenger

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]