Questions tagged [well-formed]

A well-formed expression is one that is consistent with a known set of rules for syntax, structure, or any of various constraints of a formal system. A common example is that of a well-formed XML document, where the syntax of the document is capable of being parsed and recognized as XML, even though the content of the document may not be meaningful or accurate.

Overview

A well-formed expression is one that is consistent with a known set of rules for syntax, structure, or any of various constraints of a formal system.

The formal system under consideration may be a programming language specification, a file-format specification, or any set of rules for the establishment of claims, statements, expressions or theorems capable of unambiguous encoding, decoding, and interpretation.

Example

A common example is that of a well-formed XML document, where the syntax of the document is capable of being parsed and recognized as XML, even though the content of the document may not be meaningful or accurate.

72 questions
28
votes
5 answers

How to validate JSON in PHP older than 5.3.0?

Is there any way to check that a variable is a valid JSON string in PHP without using json_last_error()? My PHP version is older than 5.3.0.
user955822
27
votes
11 answers

Check well-formed XML without a try/catch?

Does anyone know how I can check if a string contains well-formed XML without using something like XmlDocument.LoadXml() in a try/catch block? I've got input that may or may not be XML, and I want code that recognises that input may not be XML…
Steve Cooper
  • 20,542
  • 15
  • 71
  • 88
19
votes
9 answers

What is an XML infoset and in what ways is it different to an XML document?

I've tried to read http://www.w3.org/TR/xml-infoset/ and the wikipedia entry. But frankly I'm still not sure what the difference is. The quote : An XML document has an information set if it is well-formed and satisfies the namespace…
Preet Sangha
  • 64,563
  • 18
  • 145
  • 216
13
votes
2 answers

Validating against a Schema with JAXB

I've been looking for solutions to this problem for far too long considering how easy it sounds so I've come for some help. I have an XML Schema which I have used with xjc to create my JAXB binding. This works fine when the XML is well formed. …
fwg
  • 1,018
  • 2
  • 10
  • 25
8
votes
3 answers

The markup must be well-formed

First off, let me say I am a new to SAX and Java. I am trying to read information from an XML file that is not well formed. When I try to use the SAX or DOM Parser I get the following error in response: The markup in the document following the root…
Haythem
  • 417
  • 4
  • 13
  • 20
6
votes
0 answers

How to check whether, given the argument types, an implicit use of `operator ()` would result in exactly one best viable candidate?

As I understand it, the outcome of a function name usage might be one of the following: There are no (best) viable functions — overload resolution fails. The suboutcomes are: There are no candidates. There are some candidates, just none are…
6
votes
3 answers

How to parse a DocumentFragment with with the Java standard DOM API

This is how I can parse a well-formed XML document in Java: DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); // text contains the XML content Document doc =…
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
6
votes
1 answer

Is object construction expression well-formed even if that construction cannot be compiled?

Suppose we have a non-copyable type X: struct X { X(X&&) = default; X(const X&) = delete; } Then, naturally, we cannot copy a container having X as value type: std::set v; std::set v2{v} // error My question is, whether the…
Daniel Langr
  • 22,196
  • 3
  • 50
  • 93
6
votes
7 answers

What is the fastest way to programmatically check the well-formedness of XML files in C#?

I have large batches of XHTML files that are manually updated. During the review phase of the updates I would like to programmatically check the well-formedness of the files. I am currently using a XmlReader, but the time required on an average CPU…
barry
  • 1,021
  • 3
  • 13
  • 27
6
votes
2 answers

Removing invalid characters from XML before serializing it with XMLSerializer()

I'm trying to store user-input in an XML document on the client-side (javascript), and transmit that to the server for persistence. One user, for example, pasted in text that included an STX character (0x2). The XMLSerializer did not escape the STX…
Seth
  • 2,712
  • 3
  • 25
  • 41
5
votes
1 answer

template, well formedness and zero pack length rule

From the accepted answer of a previous question I've discovered a rule I didn't know about templates and well formedness The program is ill-formed, no diagnostic required, if: [...] every valid specialization of a variadic template requires an…
max66
  • 65,235
  • 10
  • 71
  • 111
5
votes
2 answers

Is a colon a legal first character in an XML tag name?

According to the W3C XML Recommendation, start tag-names have the definition: STag ::= '<' Name (S Attribute)* S? '>' ..where Name is: Name ::= NameStartChar (NameChar)* NameStartChar ::= ":" | [A-Z] | ... ..(n.b., states that a colon can appear…
Eliott
  • 332
  • 3
  • 13
4
votes
1 answer

formula vs well-formed formula in propositional logic

Can someone please explain the difference between formula in general and well-formed formula? Is it possible to determine the truth value of an ill-formed formula?
4
votes
8 answers

Is this valid YAML?

So for my text parsing in C# question, I got directed at YAML. I'm hitting a wall with this library I was recommended, so this is a quickie. heading: name: A name taco: Yes age: 32 heading: name: Another name taco: No age: 27 And so on. Is…
Bernard
  • 45,296
  • 18
  • 54
  • 69
3
votes
1 answer

Not well-formed error message in FF

My site just started to behave strange... In FF 8 I get this error (could be after I upgraded my FF, not sure): Error: not well-formed Source File: http://example.mysite.com/ws_flexihandler.ashx/functionname Line: 21, Column: 5 Source Code: HTTP/1.1…
Muleskinner
  • 14,150
  • 19
  • 58
  • 79
1
2 3 4 5