Looking for feedback for my XPath implementation

polaris · · 598 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m looking for feedback for my XPath implementation: <a href="https://github.com/ChrisTrenkamp/goxpath">https://github.com/ChrisTrenkamp/goxpath</a></p> <p>I know what the majority of you are thinking: &#34;XML? Yuck.&#34; I agree with you, but I have a job that requires working XML. So, I&#39;m kinda stuck with it for now.</p> <p>I&#39;m looking for some feedback as far as the code goes. I&#39;m also looking for some ideas on extending the parser to operate on XML-tagged structs. </p> <p>I would like to have the same functionality as this: <a href="http://www.eclipse.org/eclipselink/documentation/2.4/moxy/runtime008.htm">http://www.eclipse.org/eclipselink/documentation/2.4/moxy/runtime008.htm</a> This is handy for querying big data structures and/or complicated schema&#39;s (like what I have at my current job). Any idea&#39;s would be appreciated.</p> <hr/>**评论:**<br/><br/>uncreativemynameis: <pre><p>I created a similar package for JSON: <a href="https://github.com/nicksardo/jsonpath" rel="nofollow">https://github.com/nicksardo/jsonpath</a></p> <p>My design choices: </p> <ul> <li><p>Constant memory usage </p> <ul> <li>Don&#39;t load the entire document into memory -&gt; stream-in &amp; throw away<br/></li> <li>Don&#39;t even load the entire structure into memory -&gt; follow the path while parsing<br/></li> </ul></li> <li><p>Early termination </p> <ul> <li>Package will terminate parsing when value at end of path is found<br/></li> <li>Client can cancel parsing at any time (graceful termination for those large XML documents)</li> </ul></li> <li><p>Support expressions </p> <ul> <li>Ability to select elements based off expressions of child elements.<br/></li> </ul></li> </ul></pre>mattn: <pre><p><a href="https://github.com/mattn/go-jsonpointer" rel="nofollow">https://github.com/mattn/go-jsonpointer</a></p> <p>or</p> <p><a href="https://github.com/mattn/go-scan" rel="nofollow">https://github.com/mattn/go-scan</a></p></pre>xyproto: <pre><p>Here is another *path package, but for JSON: <a href="https://github.com/xyproto/jpath" rel="nofollow">https://github.com/xyproto/jpath</a></p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

598 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传