Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Managing tags

  Asked By: Ella    Date: Jul 14    Category: Java    Views: 567
  

I am working on a text file where I have tags. For example, I have:
"The name of the pattern is <B1> Builder </B1>".

I wanna take the words that are in the tags, e.g., both "Builder"
and the identifiers within the tags themselves, "B1", somehow. I
have been told about a class or package named Sax or Jaxp. Could
anybody tell me more about this issue? Or any other way to do it? It
has occurred to me the String Tokenizer class, but I don't think
this is a very efficient way.

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Amir Shaikh     Answered On: Jul 14

If u want to maintain tags  in a file,why don't u use xml file?If u use xml,u can
use parser(dom or sax  parser) to retrieve the details.If u use flat,it is very
difficult to retrieve the details.

 
Answer #2    Answered By: Abriana Rossi     Answered On: Jul 14

Here is the coolest way I have found to manage config files (tags). Hope
this helps.

 
Answer #3    Answered By: Mario Ryan     Answered On: Jul 14

Sax or Jaxp are parsers.
they r not classes.
this text  file is called an XML file.
java has a full technology dedicated to handling XML.

for more inf see -

http://java.sun.com/xml/tutorial_intro.html

after u finish this link, go through

http://java.sun.com/xml/download.html

 
Answer #4    Answered By: Garry Sanchez     Answered On: Jul 14

I have read the documentation about XML and I want to know if I have
understood well. I can create an xml file  from the scratch creating
a DOM and inserting in it the tags  and the text  I want. Then, I can
write out this DOM with a transformer.
This is how I create an XML file, doesn't it?

And then, if I want to recover the XML file data somewhow, I can
create a DOM again to operate with it, or reading it by SAX.Is it
correct?

And, another XML question :). If I have something like this:

<hdp>
bla bla bla
<has_solution>
ble ble ble
</has_solution>
</hdp>

is this extract well formed? I mean, the text "bla bla bla" is in a
correct way?

 
Didn't find what you were looking for? Find more on Managing tags Or get search suggestion and latest updates.




Tagged: