在JAVA中如何读取smil格式的文件啊???????

解决方案 »

  1.   

    smil文件,你先要分析它的格式。然后用java IO 不就行了
      

  2.   

    应该直接用java io就行了吧,
      

  3.   

    /** 
    * 根据smil文件路径获得smil文件中src=""的值<br> 
    * @param smilFilePath 
    * @return 
    */ 
    protected List<String[]> getSrcValues(String smilFilePath) { 
    List<String[]> srcValues = new ArrayList<String[]>();; 
    String content = ""; 
    try { 
    File smilFile = new File(smilFilePath); 
    FileInputStream fis = new FileInputStream(smilFile); 
    BufferedReader br = new BufferedReader(new InputStreamReader(fis)); String line = ""; 
    while ((line = br.readLine()) != null) { 
    content += line + "\r\n"; 
    } } catch (Exception e) { 
    e.printStackTrace(); 

    int srcCount=getSrcCount(smilFilePath); 
    int count=0; 
    while(content.indexOf("src=\"")!=-1){ 
    String test=""; 
    content=content.substring(content.indexOf("src=\"")+5); 
    test=content.substring(0, content.indexOf("\"")); 
    //System.out.println("###test["+count+"]:"+test); String valuesList[]=new String[srcCount];; 
    valuesList[count]=test; 
    System.out.println("###valuesList["+count+"]:"+valuesList[count]); 
    srcValues.add(valuesList); 
    count++; 
    } return srcValues; 
      

  4.   

    <smil xmlns="http://www.w3.org/2000/SMIL20/CR/Language">
    <head>
    <layout>
    <root-layout width="208" height="176" />
    <region id="Image" left="0" top="0" width="128" height="128" fit="hidden" />
    <region id="Text" left="0" top="50" width="128" height="128" fit="hidden" />
    </layout>
    </head>
    <body>
    <par dur="25000ms">
    <img src="1.jpg" region="Image" />
    <text src="1.txt" region="Text" />
    </par>
    <par dur="25000ms">
    <img src="2.gif" region="Image" />
    <text src="2.txt" region="Text" />
    </par>
    </body>
    </smil>
    我要获得的是width,height和src那引号里面的值啊!!!
      

  5.   

    document.getElementById("Image").width;