是否可以使用SAX解析器从XML文件中获取带有标签的值?

发布于 2025-01-29 09:47:09 字数 12906 浏览 1 评论 0原文

我解析了大XML,然后使用SAX解析器。我了解如何在XML标签之间取值。但是我需要使用标签理想地将所有值拿走,然后将它们保存到字符串中。有可能吗?

我的解析类:

    public class EUServiceHandler extends DefaultHandler {
        private StringBuilder currentValue = new StringBuilder();
        private SanctionedPerson PERSON;
        private List<SanctionedPerson> PERSONS = new ArrayList();
    
        private String MASTER_ELEMENT = "";
    
    
        @Override
        public void startElement(String uri, String localName, String qName, Attributes attributes) {
            currentValue.setLength(0);
            switch (qName) {
                //create person
                case "sanctionEntity":
                    PERSON = new SanctionedPerson();
                    PERSON.setSource(EUSL);
                    PERSON.setId(Integer.parseInt(attributes.getValue("logicalId")));
                    break;
                case "nameAlias":
                    // first name
                    if (PERSON.getFirst_name() == null || PERSON.getFirst_name() == "") {
                        if (attributes.getValue("firstName") != null || attributes.getValue("firstName") != "") {
                            PERSON.setFirst_name(attributes.getValue("firstName"));
                        }
                    }
                    // third name
                    if (PERSON.getThird_name() == null || PERSON.getThird_name() == "") {
                        if (attributes.getValue("middleName") != null || attributes.getValue("middleName") != "") {
                            PERSON.setThird_name(attributes.getValue("middleName"));
                        }
    
                    }
                    // last name
                    if (PERSON.getLast_name() == null || PERSON.getLast_name() == "") {
                        if (attributes.getValue("lastName") != null || attributes.getValue("lastName") != "") {
                            PERSON.setLast_name(attributes.getValue("lastName"));
                        }
                    }
                    // whole name
                    if (PERSON.getWholeName() == null || PERSON.getWholeName() == "") {
                        if (attributes.getValue("wholeName") != null || attributes.getValue("wholeName") != "") {
                            PERSON.setWholeName(attributes.getValue("wholeName"));
                        }
                        // function
                        PERSON.setDesignation(attributes.getValue("function"));
                    }        
                   
                    // nationality
                case "citizenship":
                    PERSON.setNationality(attributes.getValue("countryDescription"));
            }
        }
        @Override
        public void endElement(String uri, String localName, String qName) {
            switch (qName) {
                //add to List
                case "sanctionEntity":
                    PERSONS.add(PERSON);
                    break;
            }
        }
        @Override
        public void characters(char ch[], int start, int length) {
            currentValue.append(ch, start, length);
        }
    
        public List<SanctionedPerson> getSanctionedPersons() {
            return PERSONS;
        }
}

xml:

<export generationDate="2022-04-25T11:10:26.382+02:00" globalFileId="139948">
  <sanctionEntity designationDetails="" unitedNationId="" euReferenceNumber="EU.27.28" logicalId="13">
    <remark>UNSC RESOLUTION 1483</remark>
    <regulation regulationType="regulation" organisationType="commission" publicationDate="2003-07-08" entryIntoForceDate="2003-07-07" numberTitle="1210/2003 (OJ L169)" programme="IRQ" logicalId="348">
      <publicationUrl>
        http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF
      </publicationUrl>
    </regulation>
    <subjectType code="person" classificationCode="P" />
    <nameAlias firstName="" middleName="" lastName="" wholeName="Abou Ali" function="" title="" nameLanguage="FR" strong="true" regulationLanguage="en" logicalId="380">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ  L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ  /LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </nameAlias>
    <nameAlias firstName="" middleName="" lastName="" wholeName="Abu Ali" function="" title="" nameLanguage="" strong="true" regulationLanguage="en" logicalId="19">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ  L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ  /LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </nameAlias>
    <nameAlias firstName="Saddam" middleName="" lastName="Hussein Al-Tikriti" wholeName="Saddam Hussein Al-Tikriti" function="" gender="M" title="" nameLanguage="" strong="true" regulationLanguage="en" logicalId="17">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </nameAlias>
    <citizenship region="" countryIso2Code="IQ" countryDescription="IRAQ" regulationLanguage="en" logicalId="1">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </citizenship>
    <birthdate circa="false" calendarType="GREGORIAN" city="al-Awja, near Tikrit" zipCode="" birthdate="1937-04-28" dayOfMonth="28" monthOfYear="4" year="1937" region="" place="" countryIso2Code="IQ" countryDescription="IRAQ" regulationLanguage="en" logicalId="14">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </birthdate>
  </sanctionEntity>
  <sanctionEntity designationDetails="" unitedNationId="" euReferenceNumber="EU.39.56" logicalId="20">
    <remark>Saddam's second son</remark>
    <regulation regulationType="regulation" organisationType="commission" publicationDate="2003-07-08" entryIntoForceDate="2003-07-07" numberTitle="1210/2003 (OJ L169)" programme="IRQ" logicalId="348">
      <publicationUrl>
        http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF
      </publicationUrl>
    </regulation>
    <subjectType code="person" classificationCode="P" />
    <nameAlias firstName="Qusay" middleName="Saddam" lastName="Hussein Al-Tikriti" wholeName="Qusay Saddam Hussein Al-Tikriti" function="Oversaw Special Republican Guard, Special Security Organisation, and Republican Guard" gender="M" title="" nameLanguage=""
      strong="true" regulationLanguage="en" logicalId="26">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </nameAlias>
    <nameAlias firstName="Qoussaï" middleName="Saddam" lastName="Hussein Al-Tikriti" wholeName="Qoussaï Saddam Hussein Al-Tikriti" function="" title="" nameLanguage="FR" strong="true" regulationLanguage="en" logicalId="381">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </nameAlias>
    <citizenship region="" countryIso2Code="IQ" countryDescription="IRAQ" regulationLanguage="en" logicalId="2">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </citizenship>
    <birthdate circa="false" calendarType="GREGORIAN" city="Baghdad" zipCode="" year="1965" region="" place="" countryIso2Code="00" countryDescription="UNKNOWN" regulationLanguage="en" logicalId="19">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </birthdate>
    <birthdate circa="false" calendarType="GREGORIAN" city="Baghdad" zipCode="" year="1966" region="" place="" countryIso2Code="00" countryDescription="UNKNOWN" regulationLanguage="en" logicalId="20">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </birthdate>
  </sanctionEntity>
  . . . . . . . . . . .
</export>

这起作用,但我还需要完整记录每个人从标签的开头到标签末尾的人

String allXML= "<sanctionEntity designationDetails=\"\" unitedNationId=\"\" euReferenceNumber=\"EU.27.28\" logicalId=\"13\">\n" +
            "    <remark>UNSC RESOLUTION 1483</remark>\n" +
            "    <regulation regulationType=\"regulation\" organisationType=\"commission\" publicationDate=\"2003-07-08\" entryIntoForceDate=\"2003-07-07\" numberTitle=\"1210/2003 (OJ L169)\" programme=\"IRQ\" logicalId=\"348\">\n" +
            "      <publicationUrl>\n" +
            "        http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\n" +
            "      </publicationUrl>\n" +
            "    </regulation>\n" +
            "    <subjectType code=\"person\" classificationCode=\"P\" />\n" +
            "    <nameAlias firstName=\"\" middleName=\"\" lastName=\"\" wholeName=\"Abou Ali\" function=\"\" title=\"\" nameLanguage=\"FR\" strong=\"true\" regulationLanguage=\"en\" logicalId=\"380\">\n" +
            "      <regulationSummary regulationType=\"regulation\" publicationDate=\"2003-07-08\" numberTitle=\"1210/2003 (OJ  L169)\" publicationUrl=\"http://eur-lex.europa.eu/LexUriServ  /LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\" />\n" +
            "    </nameAlias>\n" +
            "    <nameAlias firstName=\"\" middleName=\"\" lastName=\"\" wholeName=\"Abu Ali\" function=\"\" title=\"\" nameLanguage=\"\" strong=\"true\" regulationLanguage=\"en\" logicalId=\"19\">\n" +
            "      <regulationSummary regulationType=\"regulation\" publicationDate=\"2003-07-08\" numberTitle=\"1210/2003 (OJ  L169)\" publicationUrl=\"http://eur-lex.europa.eu/LexUriServ  /LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\" />\n" +
            "    </nameAlias>\n" +
            "    <nameAlias firstName=\"Saddam\" middleName=\"\" lastName=\"Hussein Al-Tikriti\" wholeName=\"Saddam Hussein Al-Tikriti\" function=\"\" gender=\"M\" title=\"\" nameLanguage=\"\" strong=\"true\" regulationLanguage=\"en\" logicalId=\"17\">\n" +
            "      <regulationSummary regulationType=\"regulation\" publicationDate=\"2003-07-08\" numberTitle=\"1210/2003 (OJ L169)\" publicationUrl=\"http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\" />\n" +
            "    </nameAlias>\n" +
            "    <citizenship region=\"\" countryIso2Code=\"IQ\" countryDescription=\"IRAQ\" regulationLanguage=\"en\" logicalId=\"1\">\n" +
            "      <regulationSummary regulationType=\"regulation\" publicationDate=\"2003-07-08\" numberTitle=\"1210/2003 (OJ L169)\" publicationUrl=\"http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\" />\n" +
            "    </citizenship>\n" +
            "    <birthdate circa=\"false\" calendarType=\"GREGORIAN\" city=\"al-Awja, near Tikrit\" zipCode=\"\" birthdate=\"1937-04-28\" dayOfMonth=\"28\" monthOfYear=\"4\" year=\"1937\" region=\"\" place=\"\" countryIso2Code=\"IQ\" countryDescription=\"IRAQ\" regulationLanguage=\"en\" logicalId=\"14\">\n" +
            "      <regulationSummary regulationType=\"regulation\" publicationDate=\"2003-07-08\" numberTitle=\"1210/2003 (OJ L169)\" publicationUrl=\"http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\" />\n" +
            "    </birthdate>\n" +
            "  </sanctionEntity>";

:像我上面写的那样,可以使用SAX解析器将所有值放入字符串中吗? 提前thanx以获取所有答案。

I parse the large XML and i use SAX parser for it. I understand how to take values between XML tags. But i need to take all the values ​​ideally with the tags and save them to the string. Is this possible please?

My parsing class:

    public class EUServiceHandler extends DefaultHandler {
        private StringBuilder currentValue = new StringBuilder();
        private SanctionedPerson PERSON;
        private List<SanctionedPerson> PERSONS = new ArrayList();
    
        private String MASTER_ELEMENT = "";
    
    
        @Override
        public void startElement(String uri, String localName, String qName, Attributes attributes) {
            currentValue.setLength(0);
            switch (qName) {
                //create person
                case "sanctionEntity":
                    PERSON = new SanctionedPerson();
                    PERSON.setSource(EUSL);
                    PERSON.setId(Integer.parseInt(attributes.getValue("logicalId")));
                    break;
                case "nameAlias":
                    // first name
                    if (PERSON.getFirst_name() == null || PERSON.getFirst_name() == "") {
                        if (attributes.getValue("firstName") != null || attributes.getValue("firstName") != "") {
                            PERSON.setFirst_name(attributes.getValue("firstName"));
                        }
                    }
                    // third name
                    if (PERSON.getThird_name() == null || PERSON.getThird_name() == "") {
                        if (attributes.getValue("middleName") != null || attributes.getValue("middleName") != "") {
                            PERSON.setThird_name(attributes.getValue("middleName"));
                        }
    
                    }
                    // last name
                    if (PERSON.getLast_name() == null || PERSON.getLast_name() == "") {
                        if (attributes.getValue("lastName") != null || attributes.getValue("lastName") != "") {
                            PERSON.setLast_name(attributes.getValue("lastName"));
                        }
                    }
                    // whole name
                    if (PERSON.getWholeName() == null || PERSON.getWholeName() == "") {
                        if (attributes.getValue("wholeName") != null || attributes.getValue("wholeName") != "") {
                            PERSON.setWholeName(attributes.getValue("wholeName"));
                        }
                        // function
                        PERSON.setDesignation(attributes.getValue("function"));
                    }        
                   
                    // nationality
                case "citizenship":
                    PERSON.setNationality(attributes.getValue("countryDescription"));
            }
        }
        @Override
        public void endElement(String uri, String localName, String qName) {
            switch (qName) {
                //add to List
                case "sanctionEntity":
                    PERSONS.add(PERSON);
                    break;
            }
        }
        @Override
        public void characters(char ch[], int start, int length) {
            currentValue.append(ch, start, length);
        }
    
        public List<SanctionedPerson> getSanctionedPersons() {
            return PERSONS;
        }
}

XML:

<export generationDate="2022-04-25T11:10:26.382+02:00" globalFileId="139948">
  <sanctionEntity designationDetails="" unitedNationId="" euReferenceNumber="EU.27.28" logicalId="13">
    <remark>UNSC RESOLUTION 1483</remark>
    <regulation regulationType="regulation" organisationType="commission" publicationDate="2003-07-08" entryIntoForceDate="2003-07-07" numberTitle="1210/2003 (OJ L169)" programme="IRQ" logicalId="348">
      <publicationUrl>
        http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF
      </publicationUrl>
    </regulation>
    <subjectType code="person" classificationCode="P" />
    <nameAlias firstName="" middleName="" lastName="" wholeName="Abou Ali" function="" title="" nameLanguage="FR" strong="true" regulationLanguage="en" logicalId="380">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ  L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ  /LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </nameAlias>
    <nameAlias firstName="" middleName="" lastName="" wholeName="Abu Ali" function="" title="" nameLanguage="" strong="true" regulationLanguage="en" logicalId="19">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ  L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ  /LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </nameAlias>
    <nameAlias firstName="Saddam" middleName="" lastName="Hussein Al-Tikriti" wholeName="Saddam Hussein Al-Tikriti" function="" gender="M" title="" nameLanguage="" strong="true" regulationLanguage="en" logicalId="17">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </nameAlias>
    <citizenship region="" countryIso2Code="IQ" countryDescription="IRAQ" regulationLanguage="en" logicalId="1">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </citizenship>
    <birthdate circa="false" calendarType="GREGORIAN" city="al-Awja, near Tikrit" zipCode="" birthdate="1937-04-28" dayOfMonth="28" monthOfYear="4" year="1937" region="" place="" countryIso2Code="IQ" countryDescription="IRAQ" regulationLanguage="en" logicalId="14">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </birthdate>
  </sanctionEntity>
  <sanctionEntity designationDetails="" unitedNationId="" euReferenceNumber="EU.39.56" logicalId="20">
    <remark>Saddam's second son</remark>
    <regulation regulationType="regulation" organisationType="commission" publicationDate="2003-07-08" entryIntoForceDate="2003-07-07" numberTitle="1210/2003 (OJ L169)" programme="IRQ" logicalId="348">
      <publicationUrl>
        http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF
      </publicationUrl>
    </regulation>
    <subjectType code="person" classificationCode="P" />
    <nameAlias firstName="Qusay" middleName="Saddam" lastName="Hussein Al-Tikriti" wholeName="Qusay Saddam Hussein Al-Tikriti" function="Oversaw Special Republican Guard, Special Security Organisation, and Republican Guard" gender="M" title="" nameLanguage=""
      strong="true" regulationLanguage="en" logicalId="26">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </nameAlias>
    <nameAlias firstName="Qoussaï" middleName="Saddam" lastName="Hussein Al-Tikriti" wholeName="Qoussaï Saddam Hussein Al-Tikriti" function="" title="" nameLanguage="FR" strong="true" regulationLanguage="en" logicalId="381">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </nameAlias>
    <citizenship region="" countryIso2Code="IQ" countryDescription="IRAQ" regulationLanguage="en" logicalId="2">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </citizenship>
    <birthdate circa="false" calendarType="GREGORIAN" city="Baghdad" zipCode="" year="1965" region="" place="" countryIso2Code="00" countryDescription="UNKNOWN" regulationLanguage="en" logicalId="19">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </birthdate>
    <birthdate circa="false" calendarType="GREGORIAN" city="Baghdad" zipCode="" year="1966" region="" place="" countryIso2Code="00" countryDescription="UNKNOWN" regulationLanguage="en" logicalId="20">
      <regulationSummary regulationType="regulation" publicationDate="2003-07-08" numberTitle="1210/2003 (OJ L169)" publicationUrl="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF" />
    </birthdate>
  </sanctionEntity>
  . . . . . . . . . . .
</export>

This works but i also need to have a full record of each person from the beginning of the tag to the end of the tag like this :

String allXML= "<sanctionEntity designationDetails=\"\" unitedNationId=\"\" euReferenceNumber=\"EU.27.28\" logicalId=\"13\">\n" +
            "    <remark>UNSC RESOLUTION 1483</remark>\n" +
            "    <regulation regulationType=\"regulation\" organisationType=\"commission\" publicationDate=\"2003-07-08\" entryIntoForceDate=\"2003-07-07\" numberTitle=\"1210/2003 (OJ L169)\" programme=\"IRQ\" logicalId=\"348\">\n" +
            "      <publicationUrl>\n" +
            "        http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\n" +
            "      </publicationUrl>\n" +
            "    </regulation>\n" +
            "    <subjectType code=\"person\" classificationCode=\"P\" />\n" +
            "    <nameAlias firstName=\"\" middleName=\"\" lastName=\"\" wholeName=\"Abou Ali\" function=\"\" title=\"\" nameLanguage=\"FR\" strong=\"true\" regulationLanguage=\"en\" logicalId=\"380\">\n" +
            "      <regulationSummary regulationType=\"regulation\" publicationDate=\"2003-07-08\" numberTitle=\"1210/2003 (OJ  L169)\" publicationUrl=\"http://eur-lex.europa.eu/LexUriServ  /LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\" />\n" +
            "    </nameAlias>\n" +
            "    <nameAlias firstName=\"\" middleName=\"\" lastName=\"\" wholeName=\"Abu Ali\" function=\"\" title=\"\" nameLanguage=\"\" strong=\"true\" regulationLanguage=\"en\" logicalId=\"19\">\n" +
            "      <regulationSummary regulationType=\"regulation\" publicationDate=\"2003-07-08\" numberTitle=\"1210/2003 (OJ  L169)\" publicationUrl=\"http://eur-lex.europa.eu/LexUriServ  /LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\" />\n" +
            "    </nameAlias>\n" +
            "    <nameAlias firstName=\"Saddam\" middleName=\"\" lastName=\"Hussein Al-Tikriti\" wholeName=\"Saddam Hussein Al-Tikriti\" function=\"\" gender=\"M\" title=\"\" nameLanguage=\"\" strong=\"true\" regulationLanguage=\"en\" logicalId=\"17\">\n" +
            "      <regulationSummary regulationType=\"regulation\" publicationDate=\"2003-07-08\" numberTitle=\"1210/2003 (OJ L169)\" publicationUrl=\"http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\" />\n" +
            "    </nameAlias>\n" +
            "    <citizenship region=\"\" countryIso2Code=\"IQ\" countryDescription=\"IRAQ\" regulationLanguage=\"en\" logicalId=\"1\">\n" +
            "      <regulationSummary regulationType=\"regulation\" publicationDate=\"2003-07-08\" numberTitle=\"1210/2003 (OJ L169)\" publicationUrl=\"http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\" />\n" +
            "    </citizenship>\n" +
            "    <birthdate circa=\"false\" calendarType=\"GREGORIAN\" city=\"al-Awja, near Tikrit\" zipCode=\"\" birthdate=\"1937-04-28\" dayOfMonth=\"28\" monthOfYear=\"4\" year=\"1937\" region=\"\" place=\"\" countryIso2Code=\"IQ\" countryDescription=\"IRAQ\" regulationLanguage=\"en\" logicalId=\"14\">\n" +
            "      <regulationSummary regulationType=\"regulation\" publicationDate=\"2003-07-08\" numberTitle=\"1210/2003 (OJ L169)\" publicationUrl=\"http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2003:169:0006:0023:EN:PDF\" />\n" +
            "    </birthdate>\n" +
            "  </sanctionEntity>";

Is it possible to get all values ​​into a string using SAX parser as i wrote above?
Thanx in advance for all answers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文