Menu

trouble with a CustomTag creation

Help
2005-03-28
2013-04-27
  • Randy Paries

    Randy Paries - 2005-03-28

    Hello,
    I have a very simple html file(see below)

    I have some custom tags. <UN_TITLE>
    I am trying to get the body of the tags.

    if i do
    String [] tagsToBeFound = {"TITLE","UN_TITLE"};
    I get results when
    TagFindingVisitor visitor = new TagFindingVisitor (tagsToBeFound);
    parser.visitAllNodesWith (visitor);

    but i want to get the data/body between the UN_TITLE tags.

    so i created a UNTitleTag extends CompositeTag
    i basically copy and pasted a TitleTag.java and changed the needed words.

    but when i do
            Node nodes [] = parser.extractAllNodesThatAre(UNTitleTag.class);

    nodes is always size 0.

    is there something else i need to do?

    Thanks

    <HTML>
    <HEAD>
    <TITLE>Main</TITLE>
    </HEAD>
    <UN_TITLE>
    Unit Name HERE
    </UN_TITLE>
    </HTML>

     
    • Randy Paries

      Randy Paries - 2005-03-28

      thanks from Derrick
      factory.registerTag (new UnitNetTitleTag ());

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.