static SoyMsgBundle parseXliffTargetMsgs(String xliffContent) throws SAXException {

    // Get a SAX parser.
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
    SAXParser saxParser;
    try {
      saxParser = saxParserFactory.newSAXParser();
    } catch (ParserConfigurationException pce) {
      throw new AssertionError("Could not get SAX parser for XML.");
    }

    // Construct the handler for SAX parsing.
    XliffSaxHandler xliffSaxHandler = new XliffSaxHandler();

    // Parse the XLIFF content.
    try {
      saxParser.parse(new InputSource(new StringReader(xliffContent)), xliffSaxHandler);
    } catch (IOException e) {
      throw new AssertionError("Should not fail in reading a string.");
    }

    // Build a SoyMsgBundle from the parsed data (stored in xliffSaxHandler).
    return new SoyMsgBundleImpl(xliffSaxHandler.getTargetLocaleString(), xliffSaxHandler.getMsgs());
  }
static SoyMsgBundle parseXliffTargetMsgs ( String xliffContent ) throws SAXException { SAXParserFactory saxParserFactory = SAXParserFactory . newInstance ( ) ; SAXParser saxParser ; try { saxParser = saxParserFactory . newSAXParser ( ) ; } catch ( ParserConfigurationException pce ) { throw new AssertionError ( "Could not get SAX parser for XML." ) ; } XliffSaxHandler xliffSaxHandler = new XliffSaxHandler ( ) ; try { saxParser . parse ( new InputSource ( new StringReader ( xliffContent ) ) , xliffSaxHandler ) ; } catch ( IOException e ) { throw new AssertionError ( "Should not fail in reading a string." ) ; } return new SoyMsgBundleImpl ( xliffSaxHandler . getTargetLocaleString ( ) , xliffSaxHandler . getMsgs ( ) ) ; }
Parses the content of a translated XLIFF file and creates a SoyMsgBundle.

@param xliffContent The XLIFF content to parse.
@return The resulting SoyMsgBundle.
@throws SAXException If there's an error parsing the data.
@throws SoyMsgException If there's an error in parsing the data.