This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as ET | |
# Parse the XML file | |
tree = ET.parse('in.xml') | |
root = tree.getroot() | |
f = open("out.srt", "a") | |
# Find and print every tt:p tag | |
i = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all cardinality unlimited fields: entity->field->getValue() | |
all referenced entites: entity->field->referencedEntities() | |
one referenced entity: entity->field->entity | |
value of field: entity->field->value | |
entity reference id of field: entity->field->target_id | |
load entity by id: Entity::load(id) | |
load multiple entites by id: Entity::loadMultiple([ids]) | |
clear cache: \Drupal::service('page_cache_kill_switch')->trigger(); | |
get tabellen name of entity: ->getEntityType()->getDataTable() |