Git Product home page Git Product logo

bfs-xml's People

Contributors

jazad136 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

bfs-xml's Issues

[CMD] - Command line parser exception handling

The command line parser uses the DOMParseHelper.java file to process W3C XML documents, however, the exceptions thrown by these should be translated into this application's style of exception reporting.
SAXParseException's could be detailed with line numbers as an added bonus.

[ITER] - BFS Iteration Feature Part 2

One Piece. After Part 1 is complete, ensure a test of a file can handle the special pickup and printing of the content of "complex" text elements (those containing other elements). Use the shiporder example from w3schools.com.

[ITER] - BFS Iteration Feature Part 1

Two pieces.

  1. Ensure a run of main can handle text input sent directly as string that matches the format of well defined XML.
  2. Ensure a test of a few files can handle the pickup and printing of "simple" text elements (XML "elements" that contain only text)

[ITER] - Needs More Information

This is the main use case of the XMLIterable object.

org.w3c.xml.Document doc;
IterateBFS it = new IterateBFS(doc);
it.startXMLBFS();
while(!it.bfsDone()) { 
	Definition nextDef = it.bfsv.bfsVisit();
	boolean useful = it.continueXMLBFS(nextDef);
	if(useful && it.bfsv.parentIsReady())
		System.out.println(it.bfsv.readyParent());
}
System.out.println("Done.");

We improved upon this by using this new use case.

XMLIterable xmlIter = new XMLIterable(org.w3c.xml.Document doc)
for(Definition def : xmlIter) { 
	System.out.println(def);		
}

But here we are sorely missing information about whether the next node is the last sibling in the BFS queue. This is unfortunate, as I thought streamlining and reducing the code would make all things nice. We need a middle ground solution.

Step 1: ensure that detecting whether the sibling we're on is the last one, is accessible from XmlIterator (not iterable), so that we can go through our tests presented in issues #1 and #2 easily.

[LYR] - The Layer Tool

The code in BFS XML can be put to good use:

For an XML file that looks like this?

<cart>
  <item> 
    <name>Bean</name>
    <price>2.00</price>
    <isCandy>false</isCandy>
  </item> 
  <item> 
     <name>Jawbreaker</name>
     <price>1.00</price>
     <isCandy>true</isCandy>
  </item> 
</cart>

Take this input and read in the last "two layers" of information
where
The first layer is the tags that hold text or attributes
The final layer is the text inside the inner most tags
And create a CSV file that looks like this
...

item , name , price , candy
1, Bean , 2.00 , false
2, Jawbreaker, 1.00 , true

I like this idea. This idea makes sense as a useful way to use the output of the tool.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.