Answer the question
In order to leave comments, you need to log in
How to make a tree in the form of drop-down lists from XML?
Good day to all)
There is a task, I think from which side to approach it. Maybe you can recommend something to read or give examples to look at.
Task:
* Process xml file.
* Generate a tree in the form of drop-down lists ().
* The result should be: step by step selection of a value from the list at each nesting level.
* That is, you need to go from the choice of resolution (this is the film thickness) to the choice of post-processing values
* At the first step, the choice of resolution, after selection, a list appears with material options for this resolution,
* Select the material - PostProcessing options related to it appear (all available for this material)
* and value choices for each of PostProcessing. That is, the choice of PostProcessingValue is available after selecting the material and is grouped by PostProcessing
. As far as I understand, there should be a form of type select when hovering over which one more drop-down menu appeared. I think it is necessary to use php with the SimpleXML or DOM library, xml must be processed by xlst. Do I need to use javascript here, or can I do without it? I didn’t google something very similar, except perhaps https://habrahabr.ru/post/65077/
Here is the beginning of the xml file (it is long, but of the same type):
<?xml version ="1.0" encoding ="utf-8"?>
<Catalog>
<Scripts>
<Script>
<ScriptID>99b7e76f-b4f8-4e8a-839d-6c4c4a8f28fc</ScriptID>
<ScriptName>C/к Пленка</ScriptName>
<Resolutions>
<Resolution>
<ResolutionID>8c064d58-12a4-48df-8360-ba711a38ee98</ResolutionID>
<ResolutionName>400 dpi</ResolutionName>
<Materials>
<Material>
<MaterialID>
f145fea2-c550-49b4-98cb-468804eb517f
</MaterialID>
<MaterialName>
Пленка Белая глянцевая NAR
</MaterialName>
<MaterialDescription>
Описание пленки
</MaterialDescription>
<PostProcessings>
<PostProcessing>
<PostProcessingID>368b9ae4-b07e-4465-854a-02ddf8841b5f</PostProcessingID>
<PostProcessingName>Ламинирование...</PostProcessingName>
<PostProcessingDescription>Описание</PostProcessingDescription>
<PostProcessingValues>
<PostProcessingValue>
<PostProcessingValueID>e51310ad-7a5b-423a-b3de-a1945f04584f</PostProcessingValueID>
<PostProcessingValueName>Белая глянцевая OraJet</PostProcessingValueName>
</PostProcessingValue>
<PostProcessingValue>
<PostProcessingValueID>333decb8-d216-4d86-9806-415622b6c352</PostProcessingValueID>
<PostProcessingValueName>Белая глянцевая OraJet (удаляемый клей)</PostProcessingValueName>
</PostProcessingValue>
</PostProcessingValues>
</PostProcessing>
<PostProcessing>
<PostProcessingID>b733c91b-6e92-4b66-8e54-1d36d2d942bd</PostProcessingID>
<PostProcessingName>Упаковка</PostProcessingName>
<PostProcessingDescription>Описание</PostProcessingDescription>
<PostProcessingValues>
<PostProcessingValue>
<PostProcessingValueID>3cc78589-8071-473c-83f5-388ffa2cbfaa</PostProcessingValueID>
<PostProcessingValueName>брикетом</PostProcessingValueName>
</PostProcessingValue>
<PostProcessingValue>
<PostProcessingValueID>2377959d-be97-4bec-9892-cc683dc267b3</PostProcessingValueID>
<PostProcessingValueName>Белая глянцевая OraJet (удаляемый клей)</PostProcessingValueName>
</PostProcessingValue>
<PostProcessingValue>
<PostProcessingValueID>2377959d-be97-4bec-9892-cc683dc267b3</PostProcessingValueID>
<PostProcessingValueName>в рулон</PostProcessingValueName>
</PostProcessingValue>
</PostProcessingValues>
</PostProcessing>
</PostProcessings>
</Material>
<Material>
<MaterialID>
e51310ad-7a5b-423a-b3de-a1945f04584f
</MaterialID>
<MaterialName>
Белая глянцевая OraJet
</MaterialName>
<MaterialDescription>
Описание пленки
</MaterialDescription>
<PostProcessings>
<PostProcessing>
<PostProcessingID>368b9ae4-b07e-4465-854a-02ddf8841b5f</PostProcessingID>
<PostProcessingName>Ламинирование...</PostProcessingName>
<PostProcessingDescription>Описание</PostProcessingDescription>
<PostProcessingValues>
<PostProcessingValue>
<PostProcessingValueID>e51310ad-7a5b-423a-b3de-a1945f04584f</PostProcessingValueID>
<PostProcessingValueName>Белая глянцевая OraJet</PostProcessingValueName>
</PostProcessingValue>
<PostProcessingValue>
<PostProcessingValueID>333decb8-d216-4d86-9806-415622b6c352</PostProcessingValueID>
<PostProcessingValueName>Белая глянцевая OraJet (удаляемый клей)</PostProcessingValueName>
</PostProcessingValue>
</PostProcessingValues>
</PostProcessing>
<PostProcessing>
<PostProcessingID>b733c91b-6e92-4b66-8e54-1d36d2d942bd</PostProcessingID>
<PostProcessingName>Упаковка</PostProcessingName>
<PostProcessingDescription>Описание</PostProcessingDescription>
<PostProcessingValues>
<PostProcessingValue>
<PostProcessingValueID>3cc78589-8071-473c-83f5-388ffa2cbfaa</PostProcessingValueID>
<PostProcessingValueName>брикетом</PostProcessingValueName>
</PostProcessingValue>
<PostProcessingValue>
<PostProcessingValueID>0681f22c-ced0-4e7a-91f5-36c6c7d191bc</PostProcessingValueID>
<PostProcessingValueName>намотка на тубу</PostProcessingValueName>
</PostProcessingValue>
<PostProcessingValue>
<PostProcessingValueID>2377959d-be97-4bec-9892-cc683dc267b3</PostProcessingValueID>
<PostProcessingValueName>в рулон</PostProcessingValueName>
</PostProcessingValue>
</PostProcessingValues>
</PostProcessing>
</PostProcessings>
</Material>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question