Dealing with XML comments


 
Thread Tools Search this Thread
Top Forums Programming Dealing with XML comments
Prev   Next
# 1  
Old 09-05-2014
Dealing with XML comments

I'm writing my own simple XML parser as an experiment. It's a lot more complicated than it's supposed to be.

Things supposedly forbidden in XML comments happen all the time in the wild. You're never, ever supposed to find -- inside <!-- xml comments --> but in practice, you don't just find that, you find while(j-->d) inside them. I'm not sure how an XML parser is supposed to be able to handle that without choking -- "Hm, my XML comment seems to be followed by 37233 characters of garbage followed by some invalid syntax, I should go back and assume that's all inside the comment"?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Dealing with edge-list

I have an edge-list with nodes, edge.txt A B B J J H C A G H G A A C K G I have another file which tells me which of these nodes are important, input.txt G C A (3 Replies)
Discussion started by: Sanchari
3 Replies

2. UNIX for Dummies Questions & Answers

Dealing with sum

I have file input 1/1/2013 1AS030A 0 1083 CHINA 1/1/2013 1AS030B 0 675 KOREA 1/1/2013 1AS035A 162 662 CHINA 1/1/2013 1AS035B 51 799 INDIA 1/1/2013 1AS035C 0 731 CHINA 1/2/2013 1AS073A 10 1375 KOREA... (5 Replies)
Discussion started by: radius
5 Replies

3. Slackware

Dealing with lilo and uefi

Recently I have been trying to boot into slackware on a new laptop that came preinstalled with windows 8. I have successfully installed slackware and Lilo, but I have had great difficult attempting to boot into it. Since the laptop contains no optical drive, I have been attempting to boot into... (2 Replies)
Discussion started by: a sandwhich
2 Replies

4. Shell Programming and Scripting

Dealing with multiple files

Korn Shell I have hundreds of small files like below created every day. A midnight cron job moves them to the location /u04/temp/logs But sometimes I have to manually move these files based a certain dates or time. I have two basic requirements 1.Using mv command I want to move all .dat... (2 Replies)
Discussion started by: kraljic
2 Replies

5. UNIX and Linux Applications

Dealing with geany core

Geany : Home Page, the text editor, sometimes crashes and leaves a geany.core file. This is a binary file and supposedly contains all unsaved work and possibly some other information. Does anyone know how to deal with this file? (2 Replies)
Discussion started by: figaro
2 Replies

6. Programming

Need help with Card Dealing Program

I'm currently making a card dealing program, it is suppose to display a list of cards like this: "Ace of Heart, is red" "Two of Heart, is red" . . "Ace of Spade, is black" and so on for all suits and numbers. here is my current code: #include <stdio.h> #include <stdlib.h> #include... (3 Replies)
Discussion started by: Izzy123
3 Replies

7. Shell Programming and Scripting

Sed script, changing all C-comments to C++-comments

I must write a script to change all C++ like comments: // this is a comment to this one /* this is a comment */ How to do it by sed? With file: #include <cstdio> using namespace std; //one // two int main() { printf("Example"); // three }//four the result should be: (2 Replies)
Discussion started by: black_hawk
2 Replies

8. UNIX and Linux Applications

webinject - dealing with popups

Hello We have a webapp that launches a link in a popup. We need to use webinject to check the content of that popup but have been so far unsuccessful. We use webinject as a nagios plugin. Does anyone have any experience of using/configuring webinject and know if this is possible or not? ... (1 Reply)
Discussion started by: skewbie
1 Replies

9. Shell Programming and Scripting

AWK to skip comments in XML file

Hello, I'm trying to make a shell script to skip comments from an XML file, but with the code below only deletes comments that are in one line. Can you tell me what can be added here? nawk ' { if($0 !~/<!--/) { a=0 } if($0 ~/<!--/ && $0 ~/-->/) {a=1} if($0 ~/<!--/) {a=1} if... (1 Reply)
Discussion started by: majormark
1 Replies

10. Shell Programming and Scripting

Help in dealing with arra

I am readinga file lin by line and based craeting a arry of unique elemenst from the second column of the line. However when i coem out of the while loop my array becomes empty , can eny one tell me what I would be doing wrong #!/bin/bash logfile="./mylog.dat" begin=100 end="$(( $begin +... (5 Replies)
Discussion started by: jojan
5 Replies
Login or Register to Ask a Question
xmlparsing(3)							       Coin							     xmlparsing(3)

NAME
xmlparsing - XML Parsing with Coin For Coin 3.0, we added an XML parser to Coin. This document describes how it can be used for generic purposes. Why another XML parser, you might ask? First of all, the XML parser is actually a third-party parser, expat. Coin needed one, and many Coin-dependent projects needed one as well. We therefore needed to expose an API for it. However, integrating a 3rd-party parser into Coin, we can not expose its API directly, or other projects also using Expat would get conflicts. We therefore needed to expose the XML API with a unique API, hence the API you see here. It is based on a XML DOM API we use(d) in a couple of other projects, but it has been tweaked to fit into Coin and to be wrapped over Expat (the original implementation just used flex). The XML parser is both a streaming parser and a DOM parser. Being a streaming parser means that documents can be read in without having to be fully contained in memory. When used as a DOM parser, the whole document is fully parsed in first, and then inspected by client code by traversing the DOM. The two modes can actually be mixed arbitrarily if ending up with a partial DOM sounds useful. The XML parser has both a C API and a C++ API. The C++ API is just a wrapper around the C API, and only serves as convenience if you prefer to read/write C++ code (which is tighter) over more verbose C code. The C API naming convention may look a bit strange, unless you have written libraries to be wrapped for scheme/lisp-like languages before. Then you might be familiar with the convention of suffixing your functions based on their behaviour/usage meaning. Mutating functions are suffixed with '!', or '_x' for (eXclamation point), and predicates are suffixed with '?', or '_p' in C. The simplest way to use the XML parser is to just call cc_xml_read_file(filename) and then traverse the DOM model through using cc_xml_doc_get_root(), cc_xml_elt_get_child(), and cc_xml_elt_get_attr(). See also: XML related functions and objects, cc_xml_doc, cc_xml_elt, cc_xml_attr Version 3.1.3 Wed May 23 2012 xmlparsing(3)