[brailleblaster] Re: Utd.java

  • From: Keith Creasy <kcreasy@xxxxxxx>
  • To: "brailleblaster@xxxxxxxxxxxxx" <brailleblaster@xxxxxxxxxxxxx>
  • Date: Fri, 11 Jan 2013 21:54:28 +0000

Oh, and this if you have a brl node and want the text node that is comes just 
before:

node.query ("preceding-sibling::Text()".

I'll shut up about it but I think you are creating a lot of extra work for 
yourself.



-----Original Message-----
From: brailleblaster-bounce@xxxxxxxxxxxxx 
[mailto:brailleblaster-bounce@xxxxxxxxxxxxx] On Behalf Of John J. Boyer
Sent: Friday, January 11, 2013 4:48 PM
To: brailleblaster@xxxxxxxxxxxxx
Subject: [brailleblaster] Re: Utd.java

Thanks for the XPath expressions. However, i would rather handle this myself. 
More than just the <brl> nodes are required. We also need the <text> or <math> 
notes to which each <brl> node applies. 

John

On Fri, Jan 11, 2013 at 09:31:24PM +0000, Keith Creasy wrote:
> If you like I can fix it so you can call it from the document using an 
> Element reference and simplify with XPath. It does return a node set in 
> document order. These two expressions is all you need:
> 
> Nodes nodes = node.query ("//brl")
> Nodes nodes = node.query ("//meta[@name='brl']");
> 
> Then, for each node in nodes you just call doBrl (node)
> 
> and for meta (assuming you still need that) doUtdMeta (node);
> 
> 
> Very simple and it is fast too.
> 
> It should take maybe an hour. Should we just move it to document since that's 
> where it is used?
> 
> 
> 
> 
> -----Original Message-----
> From: brailleblaster-bounce@xxxxxxxxxxxxx 
> [mailto:brailleblaster-bounce@xxxxxxxxxxxxx] On Behalf Of John J. 
> Boyer
> Sent: Friday, January 11, 2013 4:16 PM
> To: brailleblaster@xxxxxxxxxxxxx
> Subject: [brailleblaster] Re: Utd.java
> 
> UTD.java does need simplifying The only parts that are needed are doBrlNode 
> and the methods and fields which it uses. Threading is also not needed. I 
> plan to call this method from somethere in the document package. I can be 
> sure to call it in document order. I'll get around to handling UTD.java, but 
> completing the document package takes priority. 
> 
> John
> 
> On Fri, Jan 11, 2013 at 05:52:58PM +0000, Keith Creasy wrote:
> > John.
> > 
> > Did you say you want to work on Utd.java? I think this could be a lot 
> > simpler. Finding the braille nodes is very easy, just use XPath expression 
> > "//brl" and the meta elements, "//meta". Either of these should return a 
> > node list that you can iterate.
> > 
> > 
> > The only caveat is that we have to be sure that "//brl returns the nodes in 
> > document order. I think the DOM API allows you to set this behavior.
> > 
> > 
> > Keith Creasy
> > Software Developer
> > American Printing House for the Blind KCreasy@xxxxxxx
> > Phone: 502.895.2405
> > Skype: keith537
> > 
> 
> --
> John J. Boyer, Executive Director
> GodTouches Digital Ministry, Inc.
> http://www.godtouches.org
> Madison, Wisconsin, USA
> Peace, Love, Service
> 
> 

--
John J. Boyer, Executive Director
GodTouches Digital Ministry, Inc.
http://www.godtouches.org
Madison, Wisconsin, USA
Peace, Love, Service



Other related posts: