Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4056510
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:50:11+00:00 2026-05-20T14:50:11+00:00

Given this xml: <mets:techMD ID=techMD014> <mets:mdWrap MDTYPE=PREMIS:OBJECT> <mets:xmlData> <premis:object xsi:type=premis:file xsi:schemaLocation=info:lc/xmlns/premis-v2 http://www.loc.gov/standards/premis/v2/premis-v2-0.xsd> <premis:objectIdentifier> <premis:objectIdentifierType

  • 0

Given this xml:

<mets:techMD ID="techMD014">
    <mets:mdWrap MDTYPE="PREMIS:OBJECT">
        <mets:xmlData>
            <premis:object
                    xsi:type="premis:file"
                    xsi:schemaLocation="info:lc/xmlns/premis-v2
                    http://www.loc.gov/standards/premis/v2/premis-v2-0.xsd">
                <premis:objectIdentifier>
                    <premis:objectIdentifierType
                     >filepath</premis:objectIdentifierType>
                    <premis:objectIdentifierValue
                     >bib1234_yyyymmdd_99_x_performance.xml</premis:objectIdentifierValue>
                </premis:objectIdentifier>
            </premis:object>
        </mets:xmlData>
    </mets:mdWrap>
</mets:techMD>
<mets:techMD ID="techMD015">
    <mets:mdWrap MDTYPE="PREMIS:OBJECT">
        <mets:xmlData>
            <premis:object
                    xsi:type="premis:representation"
                    xsi:schemaLocation="info:lc/xmlns/premis-v2
                    http://www.loc.gov/standards/premis/v2/premis-v2-0.xsd">
                <premis:objectIdentifier>
                    <premis:objectIdentifierType
                     >local</premis:objectIdentifierType>
                    <premis:objectIdentifierValue
                     >bib1234_yyyymmdd_99_x</premis:objectIdentifierValue>
                </premis:objectIdentifier>
            </premis:object>
        </mets:xmlData>
    </mets:mdWrap>
</mets:techMD>

I would like to make a xpath query that takes both index and attribute into account.
I.e can I combine these two into ONE query? (Its the stuff around the “object” element Im interested in):

//techMD/mdWrap[
   @MDTYPE=\'PREMIS:OBJECT\'
]/xmlData//object[1]/objectIdentifier/objectIdentifierValue

//techMD/mdWrap[
   @MDTYPE=\'PREMIS:OBJECT\'
]/xmlData//object[
   @xsi:type=\'premis:file\'
]/objectIdentifier/objectIdentifierValue

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:50:12+00:00Added an answer on May 20, 2026 at 2:50 pm

    Just replace according part to:

    object[@xsi:type='premis:file'][1]
    

    if you want first object of those who have a given xsi:type value or

    object[1][@xsi:type='premis:file']
    

    if you want the first object, providing it has a given xsi:type value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given this XML structure from (http://localhost:3000/route.xml): <objects type=array> <object> <trip0> <departure>20:01</departure> <start>Place a</start> <end>Place
Given this XML: <mets:mets> <mets:fileSec> <mets:fileGrp ID=fileGrp001 USE=image/dynamic> <mets:file ID=filebib4112678_18760203_1_24_0001_m.jp2 MIMETYPE=image/jp2 SIZE=5308416 CREATED=2009-11-10T00:00:00 USE=image/dynamic
Given this XML file: <?xml version=1.0 encoding=UTF-8?> <root> <data> <track clipid=1> <url>http://www.emp3world.com/to_download.php?id=33254</url> <http_method>GET or
Given this XML: <?php $xml = <<<XML <?xml version=1.0 encoding=UTF-8 ?> <root> <project type=residential>
Given this XML Schema snippet: <xs:element name=data> <xs:complexType> <xs:sequence> <xs:element name=param type=param minOccurs=0 maxOccurs=unbounded
Given this XML file: <users blessed=phrogz alians> <user name=phrogz id=42 /> <user name=lachtok id=3
Say I have this given XML file: <root> <node>x</node> <node>y</node> <node>a</node> </root> And I
given this xml file, i would like to extract the data out from it.
Given this XML: <foos> <foo> <name>Apple</name> <rank>1</rank> <key>asdfasdfasdf</key> </foo> <foo> <name>Orange</name> <rank>3</rank> <key>qwerqwtwetqw</key> </foo>
Given this XML in data.xml <?xml version=1.0 encoding=utf-8?> <data> <bar>100</bar> </data> I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.