
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
Extract subtrees from XML trees, making sure that the overall structure is preserved.
Extract a portion of TEI document, from the element pb@n='1' to the
element pb@n='2':
doc = Nokogiri::XML(%q{
<TEI>
<text>
<body>
<sp>
<speaker>First</speaker>
<l n='1'>a</l>
<l n='2'>a</l>
<l n='3'>a</l>
<pb n='1'/>
<l n='4'>a</l>
</sp>
<sp>
<speaker>Second</speaker>
<l n='5'>a</l>
<l n='6'>a</l>
<l n='7'>a</l>
<l n='8'>a</l>
<pb n='2'/>
</sp>
<sp>
<speaker>Third</speaker>
<l n='9'>a</l>
<l n='10'>a</l>
<l n='11'>a</l>
<pb n='3'>
</sp>
</body>
</text>
</TEI>
})
# Select all t
portion = XML::Focus(doc, 'name()="pb" and @n="1"', 'name()="pb" and @n="2"')
puts portion.to_xml # =>
# <TEI>
# <text>
# <body>
# <sp>
# <pb n='1'/>
#
# <l n='4'>a</l>
# </sp>
#
# <sp>
# <speaker>Second</speaker>
# <l n='5'>a</l>
# <l n='6'>a</l>
# <l n='7'>a</l>
# <l n='8'>a</l>
#
# <pb n='2'/>
# </sp>
# </body>
# </text>
# </TEI>
xml-focus is based on Nokogiri.
gem install xml-focus
Code : https://github.com/gioele/xml-focus
Report issues : https://github.com/gioele/xml-focus/issues
Documentation : http://rubydoc.info/gems/xml-focus
This is free software released into the public domain (CC0 license).
See the COPYING file or http://creativecommons.org/publicdomain/zero/1.0/
for more details.
FAQs
Unknown package
We found that xml-focus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.