Text Nodes and SAX
Hello,
How can I read text nodes with SAX?
Thanx!
ContentHandler has a call back called characters. You implement that and you will get all the character data.
Similar Messages
-
In SMARTFORMS when openee a Text Node, Giving a Short Dump
Hi
I am getting Short Dump in SMARTFORMS Transaction, when ever I opened a Text Node and made some changes in it.
With out opening a Text Node I can able to change and activate the SmartForm.
But if I open a Text Node I can able to make changes in the Text Node but later if i click on any other Node, it is giving a Short Dump.
But all other systems in my office are working fine.
I have tried the Utilities->Settings-> and changed the editor also.
I have also Installed the SAPGUI once again for this Issue. But still I am getting the same problem.
Can anyone Please help me on this Issue.
I am sending the error enalysis of the Short Dump.
Error analysis
Short text of error message:
Control Framework : Error processing control
Long text of error message:
Diagnosis
An error occurred when the system tried to process the commands
from the Automation Queue on the presentation server.
There are several possible reasons for this:
- The installation of the SAP GUI on the presentation server is
faulty or obsolete.
- There is an error in the application program
- There is an error in the SAPGUI or an integrated control
Procedure
1. Make sure that you have imported the appropriate Support
Package, the current kernel, and GUI patch for the release of your
system
2. Check whether the error occurs locally on one or a few PCs, or
generally on all PCs. Note whether the error only occurs for some
users, for example because of a specific Customizing setting.
If it only occurs locally, this suggests an installation problem
with the PC. Check the installation; if necessary, reinstall the
software. In the dump, search for the SY-MSGLI field, since it may
point to the cause of the error.
3. Activate the Automation Trace (in accordance with SAP Note
158985).
4.Start the transaction and continue until the screen immediately
before the dump.
5. From the System -> Utilities menu, choose Autom. Queue,
Synchronous Processing.
The status bar of the GUI displays the text:
"Automation synchron flush mode on"
6. If you now proceed with the application, the short dump will
display the ABAP call that caused the error; the Automation Trace
will contain the error on the presentation server.
7. If necessary, load the short dump and trace files on to
sapservX, so that SAP can analyze them.
Technical information about the message:
Message class....... "CNDP"
Number.............. 006
Thanks in Advance.Hi
I think dump is because of SAP GUI. If you are ECC 6.0 then install SAP GUI 710 with patch level 2 or more and check
Regards
Shiva -
Text node not showing first line?
I'm trying to figure out some unexpected behavior with the layout of Text. If I create an example program based on the API documentation
http://java.sun.com/javafx/1.2/docs/api/javafx.scene.text/javafx.scene.text.Text.html
Like so:
Stage
title: "Application title"
width: 500
height: 500
scene: Scene
content: [ Text {font: Font { size: 20 } content: "First row\nSecond row" } ]
}The resulting screen only shows "Second row", the first line is moved out of the screen above. I need to set y to 20 to show the first line.
Is that normal?Right, Text nodes have an textOrigin, which is default set to the base line. That means that y=0 is just below the letters.
But the behavior is unexpected when simply adding a Text node and nothing is visible. -
The text which is in text node is not displaying in output in smartforms
Hi,
In smartforms i created a text node and entered some text like following.
Target Quantity 60000001 60000002
Scheduled Quantity 60000003 60000004
So far delivered Quantity 60000005 60000006
Last delivered Quantity 60000007 60000008
Delivery Schedule Details
the text which i entered as above in the text node is not displaying.It is in main area.Hi
if u are using table or template inside the main window
then just mention the position of the text element
goto text element - output options- output structure tab----give line and column no.
Thanks
krushna -
Skin Text of ADF Tree Node and Leaf separately
Hi,
Is it possible to skin a tree (ADF 11g), so that the text of a node is white on black, and text of a leaf is black on white?
I know I can change the icons for a node and a leaf separately , but can't find how to change the styles of the text seperately.
Groeten,
HJHHi,
1. Thanks.. i did understand...I am creating a tree with region-countries-location... so when i drag and drop the region view as a tree ... I get a default code like this
<af:tree value="#{bindings.RegionsView1.treeModel}" var="node"
selectionListener="#{bindings.RegionsView1.treeModel.makeCurrent}"
rowSelection="single" id="t1">
<f:facet name="nodeStamp">
<af:outputText value="#{node}" id="ot1" />
</f:facet>
</af:tree>
In this i have used output text ... so how do i use the styleclass.... I am a new bie so can u also tel me how to use implement the same and alsohow to create a styleclass..........
2. I have to display a seperate icons for parent node and leaf nodes.. can u tel me how to achieve this also...
Can u provide me ur sample and also docs so that it would be helpful...
Id: [email protected]
Thx.. waiting for your reply -
Hi,
Can somebody please help me with this problem. I am trying to return a specific node name, return it, and see if it has any child nodes. Below is a snippet from my XML doc:
<description>
<genre>football simulation</genre>
<year>2004</year>
<publisher ....However, when I enter "year", I am presented with
<year>2004</year>as the child nodes of the "year" node. And when print the results from
getNodeType, the text nodes arent identified. How can I get my code to see if there are text nodes present and return the text nodes?? I'll be extrmely grateful for any help!! Thanks.
Below is some of my Java code:
NodeList docNodes = test.getElementsByTagName("year");
if(docNodes.getLength() !=0){
System.out.println("noelist length: "+docNodes.getLength());
for (int i=0; i<docNodes.getLength();i++){
Node blah = docNodes.item(i);
System.out.println(blah);
System.out.println(blah.getNodeType());
if(blah.hasChildNodes()){
System.out.println("child nodes present: "+blah.getChildNodes());
Node check = (Node) blah.getChildNodes();
System.out.println("node type: "+check.getNodeType());
if (check.getNodeType()==Node.TEXT_NODE){
System.out.println("text nodes present");
else{
System.out.println("text nodes ARENT present");
}Here is a little helper class I use when parsing DOM via Xerces. May not work equally well for jDOM or other implementations.
final public class XmlHelper extends Object {
// Class Variables //
/** TODO Consider moving this to an interface with constants */
static final public String XML_TAG_ROOT = "document";
// Constructors //
* Default constructor.
public XmlHelper() {
super();
// Static Methods //
static public Document newDocument()
throws ConfigurationException {
try {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
return builder.newDocument();
catch (ParserConfigurationException configure) {
throw new ConfigurationException("Error instantiating DOM XML parser", configure);
static public Document parse(InputStream in)
throws ConfigurationException, IOException, ParseException {
try {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
return builder.parse(in);
catch (ParserConfigurationException configure) {
throw new ConfigurationException("Error instantiating DOM XML parser", configure);
catch (SAXException parse) {
throw new ParseException("Error SAX parsing XML input stream", parse);
static public Document parse(String uri)
throws ConfigurationException, IOException, ParseException {
try {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
return builder.parse(uri);
catch (ParserConfigurationException configure) {
throw new ConfigurationException("Error instantiating DOM XML parser", configure);
catch (SAXException parse) {
throw new ParseException("Error SAX parsing XML uri '" + uri + "'", parse);
static public String serialize(Document target)
throws IOException, ConfigurationException, TransformationException {
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
serialize(target, byteOut, true);
return byteOut.toString();
static public void serialize(Document document, OutputStream target)
throws IOException, ConfigurationException, TransformationException {
serialize(document, target, false);
static public void serialize(Document document, OutputStream target, boolean indent)
throws IOException, ConfigurationException, TransformationException {
try {
Transformer transformer = TransformerFactory.newInstance().newTransformer();
if (indent)
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.transform(new DOMSource(document), new StreamResult(target));
catch (TransformerConfigurationException configure) {
throw new ConfigurationException("Error instantiating XML transformer", configure);
catch (TransformerException transform) {
/** @todo Need to write a generic transformation or serialization exception */
throw new TransformationException("Error transforming XML", transform);
static public Element getChildElement(Element parent, String name) {
Element child = null;
if (parent != null) {
NodeList childNodes = parent.getElementsByTagName(name);
switch (childNodes.getLength()) {
case 0:
System.err.println("XML element <" + parent.getNodeName() + ">" +
" has zero child nodes <" + name + "> (expecting one node)");
case 1:
child = (Element) childNodes.item(0);
break;
default:
child = (Element) childNodes.item(0);
/** @todo Consider implementing a "Warning Log" for errors such as these rather than sys.err */
System.err.println("XML element <" + parent.getNodeName() + ">" +
" has " + childNodes.getLength() + " child nodes <" + name + "> (expecting only one)");
return child;
static public List getAllChildElements(Element parent, String name) {
List elements = null;
if (parent != null) {
elements = Collections.synchronizedList(new ArrayList());
NodeList childNodes = parent.getChildNodes();
for (int current = 0; current < childNodes.getLength(); current++) {
Node node = childNodes.item(current);
if ((node instanceof Element) && node.getNodeName().equals(name)) {
elements.add(node);
return elements;
static public String getChildElementValue(Element parent, String childName) {
Element child = getChildElement(parent, childName);
return child == null ? null : getElementValue(child);
static public String getElementValue(Element parent) {
NodeList nodes = parent.getChildNodes();
int current = 0;
int length = nodes.getLength();
while (current < length) {
Node node = nodes.item(current);
if (node instanceof Text) {
String value = node.getNodeValue();
if (value != null)
return value.trim();
current++;
return "";
}- Saish -
How to import hierarchy text node from BW infoobject
I tried to import hierarchy from BW InfoObject through process chain /CPMB/IMPORT_IOBJ_HIER.
But BPC complains the hierarchy text node haven't been dimension member.
As result, I have to export the hierarchy text node to a flat file and import again which is not convenient.
Does anyone have some best practice for this?
Thank you.Hi,
You can follow the steps mentioned in the below How-to-Guide of sdn. This explains the steps to be implemeted to inport hierarchies.
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/c02d0b47-3e54-2d10-0eb7-d722b633b72e
Hope this helps.
Rgds,
Poonam -
How to read the contents of a text file and populate the data in a table ?
Hello All,
Can anyone advise on how to acheieve the above ? I am trying to read in a text file (CSV) and have the contents populated to the respective UI elements in a table. Any help is greatly appreciated.
from
Kwok WeiHi,
Let us consider you have list of names(Seperated by delimeter) in a text file and you want to display in a table.
1. Create Context Node "Names" and context attribute "Name"
2. Create Table and bind to the above context.
3.Write the following code in the "Init method.
try{
FileReader f =new FileReader("");
BufferedReader r=new BufferedReader(f);
String names=r.readLine();
Vector Names=new Vector();
// Use Tokenizer and store all the names i a vector//
for(int i=0;i<Names.size();i++){
IPrivate<<VieName>>.INameElement ele=wdContext.createNameElement();
ele.set<<Name>>( Names.get(i).toString());
wdContext.NodeName().addElement(ele);
Regards, Anilkumar
Message was edited by: Anilkumar Vippagunta -
Carriage Return in Text Node of SmartForm
Hello SAPients.
I'm working with a Text node in a SmartForm. I'm using "Include Text" to call an existing text. The text loads fine except that it doesn't respects the CR's.
What can I do?Hello SAPients!
I'm still having this problem, maybe I didn't explain the problem very well and that's why I didn't get an answer. I hope this information be more helpful:
I'm working in SAP 4.6C. I have a SmartForm with a Text Node that shows "unlimited" text. I created another transaction to maintain this text in a small text editor and save the text using FM SAVE_TEXT and retrieve it using FM READ_TEXT and it shows everything correct.
In the SmartForm I'm taking advantage of the option "Include text" in the Text type of the General Attributes of the text node. The system retrieves the text in a normal way, except that the text is shown without Carriage Return, that is, all the text is show in one single line. Do you know why?
Thank you in advance for your help. -
How to get nodes and its attributes of an XML file usiong DOM parsing?
how to get nodes and its attributes of an XML file usiong DOM parsing?
i am new to XML parsing.......
Thanking you........import org.w3c.dom.Document;
import org.w3c.dom.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException; ...
//Setup the document
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse (new File("MY_XML_FILE.xml"));
//get elemets by name
String elementValue = doc.getElementsByTagName("MY_ELEMENT").item(0).getTextContent();
//This method can return multiple nodes, in this instance I get item(0) , first nodeRead the api for other methods of getting data. -
Same child value under different parent node and these also some childs
Hi guys,
Can anyone suggest me on the hierarchy creation with duplication of node data as
follow we have
one text node under 3 childs and these have same data value &
these have some child values
here we have problem with same data node as not accept the following childs..
pls help me on this.....Hi.
have a look on this link
http://help.sap.com/erp2005_ehp_04/helpdata/EN/fb/b74d3c006f0a1de10000000a11402f/frameset.htm
hope it helps. -
XMLSearch / case in-sensitive search in a text node value with XPATH
Hi everyone,
I was aggregating some XML files and queries for a search
engine. It is pretty easy with coldfusion XML functions BUT ....
I was looking around XMLSearch to do a simple text search
into nodes and I am stuck with it.
with something like that :
selectedElements = XmlSearch(myxmldoc,
'(/directory/user[contains(.,"#form.firstName#")])');
Without loop all the XML elements, I cannot put firstName
text nodes to lower-case, do a simple search into the directory and
get user entries.
Is it possible to do with XPATH something like that :
selectedElements = XmlSearch(myxmldoc,
'(/directory/user[contains(lower-case(.),lower-case("#form.firstName#"))])');
Thanks for your help.When Do you think coldfusion will implement Xpath functions
as
http://www.w3schools.com/xpath/xpath_functions.asp
???? -
Text box and radiobutton in smartforms
Dear Friends,
How to use text boxes and radiobuttons provided in web properties tab of text in smartforms.
Please give some code if possible .
NeeteshHi Neetesh,
U can add text box using using TEMPLATE.
right click on a window node->create->template
You should be able to do that even outside a table / template object.
However, if you have a tabular format to display and your data is in a internal table, you go for a table object.
If you don't have the data in a internal table, you usually go for a TEMPLATE object
Regard,
Priyanka. -
XML parser fails to convert html encoded text nodes
Under the strain of large documents this defect rears its ugly head more often. While parsing a text node containing html encoded chars i.e. < > &; etc...
The parser will seemingly forget to change the chars at random, 99.9% of the time everything is ok and the proper conversions take place:
< -> <
> -> >
&; -> &
Once an error occurs it is reproducible until the text node is changed ( values and/or order ) then it is a crapshoot again.
These tests were done using the default UTF-8 encoding, here is the exception thrown by the parser along with a portion of the text node before and after the first parsing.
Let me be clear, the parser actually succeeds the first time but the transformation of the HTML encoded pieces possibly fails. It is on the parsing of the text node value as its own document that the parser fails.
Error 0 : Error parsing XML string! Line :: 1, Column :: 65674
Error 1 : End tag does not match start tag 'Project'.
End tag does not match start tag 'Project'.
at oracle/xml/parser/v2/XMLError.flushErrors (XMLError.java:233)
at oracle/xml/parser/v2/NonValidatingParser.parseDocument (NonValidatingParser.java:248)
at oracle/xml/parser/v2/XMLParser.parse (XMLParser.java:117)
at pacificedge/xml/XMLUtilities.loadParserFromString (XMLUtilities.java:104)
Preprocessing ::
<Project stuff0="0" stuff1="0" stuff2="0" stuff3="1" stuff4="100167" stuff5="100213">
<StuffA>100213</StuffA>
<Name>I am a Name</Name>
<StartDate>1998-08-10</StartDate>
<FinishDate>2000-06-30</FinishDate>
<Path>Folder1\Folder2</Path>
</Project>
Post processing:
<Project stuff0="0" stuff1="0" stuff2="0" stuff3="1" stuff4="100167" stuff5="100213">
<StuffA>100213</StuffA>
<Name>I am a Name</Name>
<StartDate>1998-08-10</StartDate> <-- Error is raised here when the value of the text node is used as an xml document
<FinishDate>2000-06-30</FinishDate>
<Path>Folder1\Folder2</Path>
</Project>
Please investigate this. It is a chronic problem for us and possibly many others.
nullSorry for the encoding issues in the message before here are the pertinent pieces hope this shows up correctly.
&;lt; -> &;#60;
&;gt; -> >
&;amp; -> &;#38;
Preprocessing ::
&;lt;Project stuff0="0" stuff1="0" stuff2="0" stuff3="1" stuff4="100167" stuff5="100213"&;gt;
&;lt;StuffA&;gt;100213&;lt;/StuffA&;gt;
&;lt;Name&;gt;I am a Name&;lt;/Name&;gt;
&;lt;StartDate&;gt;1998-08-10&;lt;/StartDate&;gt;
&;lt;FinishDate&;gt;2000-06-30&;lt;/FinishDate&;gt;
&;lt;Path&;gt;Folder1\Folder2&;lt;/Path&;gt;
&;lt;/Project&;gt;
Post processing:
<Project stuff0="0" stuff1="0" stuff2="0" stuff3="1" stuff4="100167" stuff5="100213">
<StuffA>100213</StuffA>
<Name>I am a Name</Name>
&;lt;StartDate>1998-08-10</StartDate> <-- Error is raised here when the value of the text node is used as an xml document
<FinishDate>2000-06-30</FinishDate>
<Path>Folder1\Folder2</Path>
</Project>
null -
Lining up root node and child nodes in JTree
I have a JTree that has a root node and n child nodes. There are no sub-levels - it is structured just like AOL instant messenger. What I want to do is have the child node icons line up directly under the root nodes text. For example (if you can read this), where "-" denotes the icon:
- root
- child
- child
Currently it is something like this:
- root
- child
- child
I have been messing with the setLeftChildIndent( int ) and setRightChildIndent( int ), but they are not doing much...they seem to not want to only move the leaf nodes but all of the nodes, so its not doing exactly what I want.
Any ideas? In the meantime I'll be looking more into how exactly those indent mutators work.
Thanks!What you want is to do a setRootVisible(false) on the JTree.
All your child nodes are then your "root level" folders.
tree.setRootVisible(true):
+root
+--child1
+--child2
+--child3
+----child3a
+----child3btree.setRootVisible(false):
+child1
+child2
+child3
+--child3a
+--child3b
Maybe you are looking for
-
How Automate Dynamically Embedding Customer Names from a List into PDF Footer?
Mavens, After discovering that a PDF training workbook of mine has been widely copied (without authorization), I'd like to "personalize" future versions of this artifact with the customer/user name dynamically embedded in each PDF's footer. Based on
-
Everytime my Apple TV 2 enters into sleeping mode it requires my WIFI network password again upon reconnection. This is new, how can I set the system to remember the password?
-
Canon 70D et Camera Raw (Photoshop CS5)
J'ai acheté un canon EOS 70D. Je n'arrive pas à utiliser Camera Raw (Photoshop CS5) avec cet appareil. Can you help me ?
-
Oracle ADF viewScope causing session size bloat
As I'm sure you know, ADF introduces some additional scopes (pageFlowScope, viewScope and backingBeanScope) on top of the standard JSF ones. Our use of one of the ADF scopes, viewScope, appears to be causing our session size to bloat over time. Objec
-
When will Delicious be available in version 4?
The Delicious Addon was available in previous versions of Firefox. Will it, or when will it, be available in version 4?