Jump to content
Fórum Script Brasil
  • 0

Script para ler o arquivo XML e modificar uma TAG especifica que se repete várias vezes


paulo.medeiros

Question

Olá, sou iniciante com scripts e preciso de ajuda com uma necessidade que surgiu.
Tenho um XML que indica Nome, Caminho, Timecode de entrada e saída e tamanho da imagem para inserir legendas no after effects.
O que acontece é que preciso de um script que leia esse documento e em seguida ache as tags <pathurl> e modifique pra um caminho que o usuário definir na hora.
Se vocês puderem me dar uma ajuda e até um exemplo do código eu ficaria grato.

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xmeml>
<xmeml version="1">
	<sequence id="SERIE_S1EP3_ Leg_ESP_LE.xml titles">
		<name>SERIE_S1EP3_ Leg_ESP_LE.xml titles</name>
		<duration>61643</duration>
		<rate>
			<ntsc>TRUE</ntsc>
			<timebase>30</timebase>
		</rate>
		<timecode>
			<string>00:00:04.06</string>
			<frame>127</frame>
			<displayformat>NDF</displayformat>
		</timecode>
		<media>
			<video>
				<format>
					<samplecharacteristics>
						<width>1920</width>
						<height>1080</height>
						<anamorphic>FALSE</anamorphic>
						<pixelaspectratio>NTSC-CCIR-601</pixelaspectratio>
					</samplecharacteristics>
				</format>
				<track>
					<clipitem>
						<name>tif0000.tif</name>
						<duration>54</duration>
						<start>0</start>
						<end>54</end>
						<stillframe>TRUE</stillframe>
						<anamorphic>FALSE</anamorphic>
						<alphatype>straight</alphatype>
						<file id="tif0000.tif">
							<name>tif0000.tif</name>
							<pathurl>\\Conversao\e\PROJETO QUEIMA DE LEGENAS AFTER\PASTA\tif0000.tif</pathurl>
							<media>
								<video>
									<duration>2</duration>
									<stillframe>TRUE</stillframe>
									<samplecharacteristics>
										<width>1920</width>
										<height>1080</height>
									</samplecharacteristics>
								</video>
							</media>
						</file>
					</clipitem>
					<clipitem>
						<name>tif0001.tif</name>
						<duration>98</duration>
						<start>55</start>
						<end>153</end>
						<stillframe>TRUE</stillframe>
						<anamorphic>FALSE</anamorphic>
						<alphatype>straight</alphatype>
						<file id="tif0001.tif">
							<name>tif0001.tif</name>
							<pathurl>\\Conversao\e\PROJETO QUEIMA DE LEGENAS AFTER\SERIE_S1EP3_ Leg_ESP_LE\tif0001.tif</pathurl>
							<media>
								<video>
									<duration>2</duration>
									<stillframe>TRUE</stillframe>
									<samplecharacteristics>
										<width>1920</width>
										<height>1080</height>
									</samplecharacteristics>
								</video>
							</media>
						</file>
					</clipitem>
					<clipitem>
						<name>tif0002.tif</name>
						<duration>83</duration>
						<start>370</start>
						<end>453</end>
						<stillframe>TRUE</stillframe>
						<anamorphic>FALSE</anamorphic>
						<alphatype>straight</alphatype>
						<file id="tif0002.tif">
							<name>tif0002.tif</name>
							<pathurl>\\Conversao\e\PROJETO QUEIMA DE LEGENAS AFTER\SERIE_S1EP3_ Leg_ESP_LE\tif0002.tif</pathurl>
							<media>
								<video>
									<duration>2</duration>
									<stillframe>TRUE</stillframe>
									<samplecharacteristics>
										<width>1920</width>
										<height>1080</height>
									</samplecharacteristics>
								</video>
							</media>
						</file>
					</clipitem>

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      651.9k
×
×
  • Create New...