f



Newbie question : Xerces (C++) How do I create the <?xml version="1.0" encoding="UTF-8" ?> header

I have created a XML Writer program, and everything works, but I need to
revice my code and add this "version and encoding" header for completeness
and correctness... I am completely stuck!

I have done this so far:

DOM_Element root = xmlDoc.getRootElement();
root.setAttributes ("xmlns","etc.etc.");

Do I have to previous root called "?" - but this doesn't make much sense as
the tag begins "<?xml" and ends "?>"

From scouring the web, I believe that I coding with a legacy version of
xerces-c. (hence DOM_Element)
I cannot change or update the library

Please can I have a snippet of code?

Thanks a lot!



0
nose_pam (2)
5/14/2004 9:04:17 AM
comp.text.xml 8781 articles. 0 followers. Post Follow

2 Replies
804 Views

Similar Articles

[PageSpeed] 16

I hope this reads a bit nicer:  Hands moving quicker than brain(!)

 I have created a XML Writer program, and everything works, but I need to
revise my code and add this "version and encoding" header for completeness
and correctness... I am completely stuck!

 I have done this so far:

 DOM_Element root = xmlDoc.getRootElement();
root.setAttributes ("xmlns","etc.etc.");

Do I have to create another previous root called "?" - but this doesn't make
much sense as the tag begins "<?xml" and ends "?>"

From scouring the web, I believe that I coding with a legacy version of
xerces-c. (hence DOM_Element): I cannot change or update the library

Please can I have a snippet of code?

Thanks a lot!



0
nose_pam (2)
5/14/2004 9:30:49 AM
In article <c8225m$nat$1@rdel.co.uk>,
mel-tey chamon! <nose_pam@nose_pam.com> wrote:

% I have created a XML Writer program, and everything works, but I need to
% revice my code and add this "version and encoding" header for completeness
% and correctness... I am completely stuck!

This is called the XML declaration. It's not an element. There should
be an attribute on the document class which says whether to write the
XML declaration, though.

-- 

Patrick TJ McPhee
East York  Canada
ptjm@interlog.com
0
ptjm (515)
5/16/2004 2:34:02 AM
Reply:

Similar Artilces:

<script type="text/javascript" charset="utf-8"> // <!-- ?
Hi, I've seen some pages that comment inlined <scripts> in this way: <script type="text/javascript" charset="utf-8"> // <!-- .... Here goes the script src // --> </script> The reasoning being that it avoids the need to escape any tags inside the script. But it's not very common. Why ? Any thoughts ? -- Jorge. Ry Nohryb wrote: > I've seen some pages that comment inlined <scripts> in this way: > > <script type="text/javascript" charset="utf-8"> > // <!-- It's...

"""""""""ADD ME""""""""""
Hi , Hope you are doing great. Please let me take this opportunity to introduce myself, Iam Karthik working with BhanInfoi Inc, a NY based company. We have consultants on our bench on various technologies, my request is to add me to your distribution list and kindly do send me the requirements. i have the below list available 1. Mainframe 2. Java 3.. Financial Analyst 4. Data Architect If there is any vendor ship agreement which has to be signed then I would like to take an opportunity to represent my company and expect your cooperation... ...

"cat <> file" and "echo "ddd" >&2 2>&1" questions
Hi All 1. what is "cat <> file" means? is that means read line ,echo to stdout ,and write back to file? but I think command should be "cat <>> file" which fails. 2. $echo "ddd" >&2 2>&1 ddd $echo "ddd" 2>&1 >&2 ddd $ which "fd" be used on earth? Is there any way to display what fd be used? like : $echo "ddd" 1:ddd thanks On Sun, 19 Aug 2007 20:56:32 +0800, Key9 wrote: > Hi All > > 1. > what is "cat <> file" means? > is that means read line ,echo to st...

<?xml version="1.0" ?>
The line <?xml version="1.0" ?> appears at the top of about 20% of my incoming e-mail. Anyone know the source? I get a lot of it from co-workers and would be happy to tell them how to get rid of it. - Henry ...

how make /%([0-f]{2})/ -> sprintf( "%c", "\x" "\\1" ) problem : var = "\x27" # work var = 27 ; var = "\x" var ; # doesnt work, for sprintf %c
.... On 27.10.2014 18:32, {xmb} wrote: > ... > What a stupid question! Read http://www.catb.org/esr/faqs/smart-questions.html and Learn or Leave thank you _not_ for your useless text. if u want to help do so, u didnt. On Tue, 28 Oct 2014 07:42:00 -0700, {xmb} wrote: > thank you _not_ for your useless text. if u want to help do so, u didnt. Your question was unintelligible. The people in this group are very willing to help, in my experience. Your question just did not show the proper attitude or mental state to justify spending time answering. ...

"my" and "our"
Hi, while testing a program, I erroneously declared the same variable twice within a block, the first time with "my", the second time with "our": { my $fz = 'VTX_Link'; .... ( around 200 lines of code, all in the same block) our $fz = 'VTX_Linkset'; ... } So the initial contents of the $fz declared with "my" is lost, because "our" creates a lexical alias for the global $fz, thus overwriting the previous "my" declaration. It was my error, no question. But I wonder why Perl doesn't mention this - even with "use s...

"/a" is not "/a" ?
Hi everybody, while testing a module today I stumbled on something that I can work around but I don't quite understand. >>> a = "a" >>> b = "a" >>> a == b True >>> a is b True >>> c = "/a" >>> d = "/a" >>> c == d True # all good so far >>> c is d False # eeeeek! Why c and d point to two different objects with an identical string content rather than the same object? Manu Emanuele D'Arrigo wrote: >>>> c = "/a" >>>&...

about "++" and "--"
why this program snippet display "8,7,7,8,-7,-8" the program is: main() { int i=8; printf("%d\n%d\n%d\n%d\n%d\n%d\n",++i,--i,i++,i--,-i++,-i--); } > why this program snippet display "8,7,7,8,-7,-8" Ask your compiler-vendor because this result is IMHO implementation-defined. Check this out: http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.15 http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.16 Regards, Irina Marudina fxc123@gmail.com wrote: > why this program snippet display "8,7,7,8,-7,-8&q...

why "::", not "."
Why does the method of modules use a dot, and the constants a double colon? e.g. Math::PI and Math.cos -- Posted via http://www.ruby-forum.com/. On Oct 26, 2010, at 01:48 , Oleg Igor wrote: > Why does the method of modules use a dot, and the constants a double > colon? > e.g. > Math::PI and Math.cos For the same reason why inner-classes/modules use double colon, because = they're constants and that's how you look up via constant namespace. Math::PI and ActiveRecord::Base are the same type of lookup... it is = just that Base is a module and PI is a float....

"out" and "in out"
Hi i found the following explaination: In Ada, "in" parameters are similar to C++ const parameters. They are effectively read-only within the scope of the called subprogram. Ada "in out" parameters have a reliable initial value (that passed in from the calling subprogram) and may be modified within the scope of the called procedure. Ada "out" parameters have no reliable initial value, but are expected to be assigned a value within the called procedure. What does "have no reliable initial value" mean when considering the "out" parameter? By c...

"or" and "and"
Hi, I'm just getting to discover ruby, but I find it very nice programming language. I just still don't understand how the "or" and "and" in ruby... I was playing with ruby and for example made a def to print Stem and Leaf plot (for those who didn't have a statistics course or slept on it, e.g. http://cnx.org/content/m10157/latest/) Here is the Beta version of it: class Array def n ; self.size ; end def stem_and_leaf(st = 1) # if st != (2 or 5 or 10) then ; st = 1 ; end k = Hash.new(0) self.each {|x| k[x.to_f] += 1 } k = k.sort{|a, b| a[0].to_f <=&g...

file command: "XML document text" vs "XML document text"
I've just used the file command on four files of RDF-XML with the following output: augtfidf.rdf: XML document text kyoto.rdf: XML document text stuff.rdf: XML document text tfidf.rdf: XML document text What does it mean that one of them has an extra space between "XML" and "document"? -- The kid's a hot prospect. He's got a good head for merchandising, an agent who can take you downtown and one of the best urine samples I've seen in a long time. [Dead Kennedys t-shirt] On 16.10.2012 16:06, Adam Funk wrote: > I've just used the file command on four files of RDF-XML with the > following output: > > augtfidf.rdf: XML document text > kyoto.rdf: XML document text > stuff.rdf: XML document text > tfidf.rdf: XML document text > > What does it mean that one of them has an extra space between "XML" > and "document"? Hard to tell without further information. What does file *.rdf | od -c show you? Janis Janis Papanagnou wrote: > On 16.10.2012 16:06, Adam Funk wrote: >> I've just used the file command on four files of RDF-XML with the >> following output: >> >> augtfidf.rdf: XML document text >> kyoto.rdf: XML document text >> stuff.rdf: XML document text >> tfidf.rdf: XML document text >> >> What does it mean that one ...

"new" [<TypeArguments>] <ClassOrInterfaceType> "(" [<ArgumentList>] ")"
According to http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.9 the following production holds <ClassInstanceCreationExpression> ::= "new" [<TypeArguments>] <ClassOrInterfaceType> "(" [<ArgumentList>] ")" What would be an example for a class instance creation expression with type arguments? Here's a reminder about those: <TypeArguments> ::= "<" <TypeArgument> {"," <TypeArgument>} ">" What I would understand would be: <ClassInstanceCre...

Question about "sprintf" "@" "do for"
Hello, this works: A1=3D1 A2=3D2 A3=3D3 i=3D1 vari=3Dsprintf("A%.f",i) print vari,"=3D",@vari i=3Di+1 vari=3Dsprintf("A%.f",i) print vari,"=3D",@vari i=3Di+1 vari=3Dsprintf("A%.f",i) print vari,"=3D",@vari do for [i=3D1:3]{ vari=3Dsprintf("A%.f",i) print vari } But I want to have "print vari,"=3D",@vari" in the loop. But it dosen't=20 work. Why can't I use "print vari,"=3D",@vari" in the loop? Is there a=20 solution for? J=C3=B6rg Jörg ...

strcmp("C", "Java") > 0 == 1
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html ...

SAX Parser and <?xml version="1.0" ?>
I have produced a SAX parser using Xerces to scan some external XML documents. It works okay except when the file contains "<?xml version="1.0" ?>". If this is in the file I get the error: [Fatal Error] :4:6: The processing instruction target matching "[xX][mM][lL]" is not allowed. org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed. at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) Why is this and how do I get round it. Thanks Jon John Smith wrote: > I h...

why have both "." and "->" ?
I used to remember why c++ needed both ? Could somebody help me here ? For example class A{ f(); }; A* aa; You could do either "aa->f()" or "(*aa).f()". So why does C++ need both operators. Raj "raj" <rajkumar@hotmail.com> schreef in bericht news:d7fee6d0.0406230748.694b966b@posting.google.com... > I used to remember why c++ needed both ? > Could somebody help me here ? > > For example > > class A{ > f(); > }; > > A* aa; > > You could do either "aa->f()" or "(*aa).f()". So why does C++...

["a", "b", "c", "d"] to "a, b, c, d"?
I want to process each element of an array, but the last element should be handled special. Here is an example: def p_ary(ary) str = "" ary.each do |elem| str << elem << ", " end str.chomp!(", ") str end so p_ary(["a", "f", "x", "test"]) produces "a, f, x, test". The code works, but isn't there an easier and more general way for this behaviour? martinus On Tue, 06 Apr 2004 04:23:22 -0700, Martin wrote: > I want to process each element of an array, but the last ele...

Does it need a ";" at the very after of "if" and "for"
write code like: int main(void) { int a=10; if(a<20) {} } Compiler ok on dev-cpp . don't we have to add a ";" after if statement? marsarden said: > write code like: > > int main(void) > { > int a=10; > if(a<20) > {} > } > > Compiler ok on dev-cpp . don't we have to add a ";" after if > statement? The syntax for 'if' is: if(expression) statement There is no semicolon after the ) but before the statement. The statement is either a normal statement (which can be empty), ending in a semicolon:- if(expr) ...

"In" "Out" and "Trash"
I just bought a new computer and I re-installed Eudora Light on my new computer. But when I open Eudora, the "In", "Out" and "Trash" links are not on the left side of the screen the way they were on my old computer. How can I get these links back on the left side of the screen? Thank you. On 25 Mar 2007 09:49:22 -0700, "abx" <abfunex@yahoo.com> wrote: >I just bought a new computer and I re-installed Eudora Light on my new >computer. But when I open Eudora, the "In", "Out" and "Trash" links >are ...

XML problem with special characters like "<" and ">"
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag domElement = domDocument.createElement ("ROOT_TAG"); domDocument.appendChild (domElement); // XML from an external source as a "String" Text data = domDocument.createTextNode (externalXML); domElement.appendChild (data); writer.println (...); ------------------------------------------------------- As you can see, I create a normal Root-Node and then I get an XML stream from an external source. For the external XML I use the function "createTextNode" because it is a text in some way. The problem is the output when I write all together to the PrintWriter object. It looks like this for this example: -------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <ROOT_TAG> &lt;DATA&gt; &lt;AFL&gt; &lt;AFLNR&gt;XX&lt;/AFLNR&gt; &lt;BENENNUNG&gt;MY TEST&lt;/BENENNUNG&gt; &lt;LA_VER&gt;&lt;/LA_VER&gt; &lt;FA_KR&gt;&lt;/FA_KR&gt; &lt;POL_COD&gt;&lt;/POL_COD&gt; &lt;FA_KZ&gt;&lt;/FA_KZ&gt; &lt;G_KZ&gt;&lt;/G_KZ&gt; &lt;AFL_KZ&gt;1&lt;/AFL_KZ&gt; &lt;/AFL&gt; &lt;/DATA&gt; </ROOT_TAG> -...

XML problem with special characters like "<" and ">"
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag domElement = domDocument.createElement ("ROOT_TAG"); domDocument.appendChild (domElement); // XML from an external source as a "String" Text data = domDocument.createTextNode (externalXML); domElement.appendChild (data); writer.println (...); ------------------------------------------------------- As you can see, I create a normal Root-Node and then I get an XML stream from an external source....

c++ <vector> version of fortran "merge" or "where"
Hi, I have several <vector>'s of the same length, with entries as follows: I=[0,3,6,0,5,3,0] A=[1,2,3,4,5,6,7] B=[2,3,4,5,6,7,8] I want to use STL to make (I == 0) a mask to operate on the elements of A and B, i.e. I want to do this: for (int i=0;i<I.size();i++){ if ( I[i] == 0 ){ A[i] = 0; B[i] = 0; } } In fortran 90 it would be easy: A = merge( 0, A, I==0 ) B = merge( 0, B, I==0 ) Can anybody point out how to do it in C++? I don't see how replace_if can do it. Thanks in advance, Sean Dettrick "Sean Dettrick" <sdettrick@hotmail.com> w...

what does "->" and "=>" do?
I have read through php.net manuals and have not see any mention about what these operands actually do. I have seen them used in a bunch of different code lately and don't really understand. Example 1: // Legacy Function: Renders the Footer of the Theme function themefooter() { global $engine, $index, $themepath; if ($index != 3) { $engine->do_themefooter($index); } } Example 2: // get the color scheme $colors = pnModAPIFunc('Xanthia','user','getSkinColors', array('skinid' => $skinID, 'paletteid' => $paletteid)); If anyo...

Web resources about - Newbie question : Xerces (C++) How do I create the <?xml version="1.0" encoding="UTF-8" ?> header - comp.text.xml

Resources last updated: 3/14/2016 12:50:41 AM