sgml

Parsing Java String with SGML

自古美人都是妖i 提交于 2019-12-12 02:19:15
问题 I have a Java String with SGML, something like this... <misspell></misspell><plain>I</plain> <plain>know</plain> <plain>you</plain> <suggestion>ducky</suggestion> <plain>suck</plain> <plain>and</plain> <plain>I</plain> <plain>rocky</plain> <plain>rock</plain> How do I parse it to get for instance say the text inside <suggestion> </suggestion> so as to get "ducky" out?? Will javax.swing.text.html.parser.Parse can be of any help? or I can only parse HTML docs with it? 回答1: The string you show

quoting HTML attribute values

自古美人都是妖i 提交于 2019-12-12 01:34:44
问题 I know the spec allows both ' and " as delimiters for attribute values, and I also know it's a good practice to always quote. However I consider " being the cleaner way, maybe it's just me having grown up with C and C++' syntax. What is the cleanest way of quoting attribute values and why? Please no subjective answers. 回答1: Both are fine, but Double quotes are better (IMHO) as you reduce the risk of dynamic values causing errors. e.g. <input value='${lastName}'/> <input value='O'Graddy'/> ^^^

DTD. Element Type Declaration. Different between 'contentspec' and 'content model'

痞子三分冷 提交于 2019-12-10 23:03:42
问题 I read Extensible Markup Language (XML) 1.0 (Fifth Edition) W3C Recommendation 26 November 2008 3.2 Element Type Declarations has: An element type declaration takes the form: Element Type Declaration elementdecl ::= <!ELEMENT Name contentspec > contentspec ::= 'EMPTY' | 'ANY' | Mixed | children And in 3.2.1 Element Content has: Element-content Models children ::= (choice | seq) ('?' | '*' | '+')? cp ::= (Name | choice | seq) ('?' | '*' | '+')? choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')' seq

WYSIWYG XML Editor (DTD or RelaxNG or XSD based grammars) [closed]

放肆的年华 提交于 2019-12-10 09:45:53
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I'm need to make a WYSIWYG XML editor for a custom XML grammar. I have explored all the OpenSource tools that I could find under this domain. Includes VEX, Oxygen, Bitflux... None of them served my purpose. I'm

Make emacs always close html tags

杀马特。学长 韩版系。学妹 提交于 2019-12-05 08:53:05
How can I make emacs always close a sgml-tag (C-c-C-t)? For example div , h2 tags work fine but p or li do not. Basically I'm looking for a way of specifing that I'm always using xhtml when I insert a tag. You need to turn on sgml-xml-mode : When non-nil, tag insertion functions will be XML-compliant. sgml-mode attempts to guess whether your buffer is in XHTML (and so turn on sgml-xml-mode automatically) by looking at the doctype. See the function sgml-xml-guess . It's expecting to find the string "XHTML" somewhere in the DTD name. If you can't get sgml-xml-guess to work, then you could turn

Strategy for parsing LOTS and LOTS of not-so-well formed SGML / XML documents

南楼画角 提交于 2019-12-02 02:23:38
I have thousands of SGML documents, some well-formed, some not so well-formed. I need to get at certain ELEMENTS in the documents, but everytime I go to load and try to read them into an XDocument, XMLDocument, or even just a StreamReader, I get different various XMLException errors. Things like "'[' is an unexpected token.". Why? Because I have a document with DOCTYPE like <!DOCTYPE RChapter PUBLIC "-//LSC//DTD R Chapter for Authoring//EN" [] > and I have learned that the "[]" needs to have something valid inside. Again, I don't control the creation of the documents, but I DO HAVE to "crack"

Java SGML to XML conversion?

扶醉桌前 提交于 2019-12-01 22:42:04
问题 Does anyone know of a method, or library, to convert SGML into XML? EDIT: For clarification, I have to do the conversion in Java, and I cannot use the SP parser or the related SX tool. 回答1: It seems that the general consensus is that there are no existing libraries for doing SGML work in Java. Certainly after several days of fruitlessly searching Google, and asking this question here, I have found no resources on this subject. 回答2: The answer is not always that simple, as it depends on the

Java SGML to XML conversion?

爱⌒轻易说出口 提交于 2019-12-01 21:48:59
Does anyone know of a method, or library, to convert SGML into XML? EDIT: For clarification, I have to do the conversion in Java, and I cannot use the SP parser or the related SX tool. It seems that the general consensus is that there are no existing libraries for doing SGML work in Java. Certainly after several days of fruitlessly searching Google, and asking this question here, I have found no resources on this subject. The answer is not always that simple, as it depends on the sgml DTD. I haven't actually found a general SGML parser in Java at all, but this article uses SP which includes a

sgml to xml conversion

孤街醉人 提交于 2019-11-29 23:44:54
问题 I have a following sample sgml data from my .sgm file and I want convert this in to xml <?dtd name="viewed"> <?XMLDOC> <viewed >xyz <cite> <yr>2010 <pno cite="2010 abc 1188">10 <?/XMLDOC> <?XMLDOC> <viewed>abc. <cite> <yr>2010 <pno cite="2010 xyz 5133">9 <?/XMLDOC> Output should be like this: <index1> <num viewed="xyz"/> <heading>xyz</heading> <index-refs> <link caseno="2010 abc 1188</link> </index-refs> </index-1> <index1> <num viewed="abc"/> <heading>abc</heading> <index-refs> <link caseno=

HTML5 is not based on SGML, so what is it based on then?

戏子无情 提交于 2019-11-29 12:15:21
问题 http://www.w3schools.com/tags/tag_doctype.asp HTML5 is not based on SGML, and therefore does not require a reference to a DTD. On what standard is HTML 5 based on if not on SGML? 回答1: The HTML5 standard specifies two serializations of HTML5: "html" and "xml". "xml" is a valid XML serialization (which in turn is a subset of SGML). "html" is not based on any specific serialization standard anymore, it has its own complete serialization. Herein lies the difference: HTML4 has a "sgml"